WordPress guide

Plugin on WordPress.org · block + shortcode

Construction calculators in WordPress, with a block

The Craft Quantities Calculators plugin is in the official WordPress.org directory. It adds a block with a searchable list of the calculators and a [craftquantities] shortcode, and both fit the frame's height for you. Without the plugin, a Custom HTML block takes the plain snippet.

  • Block + shortcodeWhat it adds
  • AutomaticHeight
  • 6.0+WordPress
  • FreePlugin and calculators

Before you start

  • A self-hosted WordPress site, version 6.0 or later, running PHP 7.4 or later.
  • An account allowed to install plugins (an administrator on most sites).
  • On WordPress.com: plugins, iframes and scripts need a paid plan with hosting features activated; on the free plan use a link to the calculator instead.

Step by step

  1. Find the plugin

    In the dashboard open Plugins, then Add New Plugin, and type Craft Quantities Calculators into the search box. Or open the listing on WordPress.org to read it first.

  2. Install and activate

    Click Install Now on the plugin's card, then Activate. It adds no settings page: everything is set on each block.

  3. Add the block

    Edit a post or a page, click the + block inserter and search for Craft Quantities. Insert the Craft Quantities Calculator block where the calculator should appear.

  4. Pick the calculator

    Type into the block's Calculator field to search the list (tile, deck, concrete…) and choose one; the editor previews it at once.

  5. Set units, language, theme and height

    In the block's sidebar: Units pins metric or imperial, Language lists only the languages that calculator is published in, Theme forces light or dark, and a Height of auto fits the frame to the calculator.

  6. Publish

    Update or publish the post and open it while logged out. The credit line, "Calculator by Craft Quantities", appears under the frame; keep it.

Your code

Shortcode (classic editor, widgets)
[craftquantities calc="concrete-calculator" theme="auto" height="auto"]

Paste it into a post, a page or a text widget. The plugin frames the whole calculator; the compact format is for the plain snippet below.

Custom HTML block (without the plugin)
<iframe src="https://craftquantities.com/embed/?calc=concrete-calculator" width="100%" height="900" loading="lazy" style="border:1px solid #e4e4e7;border-radius:12px;max-width:100%" title="Concrete Calculator — Craft Quantities"></iframe>
<p style="margin:4px 0 0;font:12px/1.4 system-ui,sans-serif">Calculator by <a href="https://craftquantities.com/calculators/materials-quantities/concrete-calculator/">Craft Quantities</a></p>
<script>(function(){if(window.cqEmbedFit)return;window.cqEmbedFit=1;window.addEventListener("message",function(e){var d=e.data;if(!d||d.source!=="craft-quantities"||d.type!=="size"||typeof d.height!=="number"||!isFinite(d.height))return;var f=document.getElementsByTagName("iframe");for(var i=0;i<f.length;i++){if(f[i].contentWindow!==e.source)continue;var a=document.createElement("a");a.href=f[i].src;if(a.protocol+"//"+a.host!==e.origin)return;f[i].style.height=Math.min(6000,Math.max(200,Math.ceil(d.height)))+"px";return}})})();</script>

For a Custom HTML block: the frame, the credit line and the fitting script. WordPress removes iframes and scripts saved by users without the unfiltered_html capability, so an editor or administrator must save it.

Every other option is in the full builder.

What visitors see

Your post · How much concrete for a shed slab?

Calculator by Craft Quantities

  • The WordPress block editor with the Craft Quantities Calculator block selected: the concrete calculator's inputs in the post, and the block's settings for calculator, units, language, theme and height in the sidebar.
    The block in the editor: pick a calculator from the searchable list, then set units, language, theme and height.
  • The concrete calculator on a published post, worked out for a shed slab: the concrete with waste, then the bag counts, the edge forms and the sub-base lines.
    A calculator on a published page, worked out as the reader types, with every result line.
  • The same post on a phone: the calculator fills the column under the article's introduction.
    The same calculator on a phone.

Every shortcode option

The block's sidebar offers the same choices. Only calc is required; the rest fall back to the defaults shown.

calc
The calculator's slug, the last part of its address on this site, for example concrete-calculator. Required.
units
imperial, metric or auto. Default auto: the reader's own setting.
lang
en, es, fr, pt or auto. Default: the site's language. Where the calculator's translated page is published, the frame shows it; until then, the English calculator with the credit in your language.
theme
light, dark or auto. Default auto: follows the reader's system.
height
auto (default), which fits the calculator, or a number of pixels from 200 to 6000.
heading
0 hides the calculator's own heading, for a page whose heading already names it.
credit
follow (default) or nofollow. The credit line is always shown; this only adds rel="nofollow" to its link.

Troubleshooting

The block is not in the inserter
The plugin is installed but not active, or the search used another word. Activate it under Plugins and search the inserter for Craft Quantities.
The iframe vanished after saving
A Custom HTML block was saved by a user without unfiltered_html; contributors and authors lack it, and on a multisite network only super admins have it. Use the plugin's block, which needs no raw HTML.
The calculator list in the block is empty
Your server could not reach this site's public calculator list. The plugin then uses the copy bundled with it, so the block still works; try again later for calculators added since.
The frame does not fit its content
Set the height to auto. If an optimisation plugin delays or combines scripts, exclude the plugin's small fitting script from it, or give the block a fixed height.
It does not work on WordPress.com
WordPress.com allows plugins and iframes only on paid plans with hosting features activated. On other plans, link to the calculator's page instead.

Why it helps

  • A how-to post answers its own question: the reader types the measurements of their slab or room and gets the quantity, without leaving your article.
  • Nothing to maintain: the frame is served from this site, so corrections and new calculators reach every post that embeds them.
  • Privacy stays simple: the plugin and the frame set no cookies, show no ads and run no analytics.
  • The plugin is GPL-licensed and listed in the official directory, so updates arrive through the dashboard like any other plugin's.

Sources

Checked against these help pages on 26 November 2026.

  1. WordPress.org: Craft Quantities Calculators (plugin listing)
  2. WordPress documentation: Custom HTML block
  3. WordPress documentation: Roles and capabilities
  4. WordPress.com support: Custom HTML block