WordPress
Requirements: a self-hosted WordPress 6.3 or newer, access to the theme's functions.php (or the ability
to add a small plugin), and one of the site's two site keys: the production key for the live site, the staging key for a test copy (npx taggor sites list shows both; Sites and environments explains them).
Install the snippet once
Section titled “Install the snippet once”Add this to your theme's functions.php (a child theme, so an update does not remove it) or to a small
plugin of your own:
add_action( 'wp_enqueue_scripts', function () { wp_enqueue_script( 'taggor', 'https://cdn.taggorcdn.com/s/<site-key>.js', array(), null, array( 'strategy' => 'async', 'in_footer' => true ) );} );wp_enqueue_script with the async strategy and in_footer loads the script without blocking the page
and is available from WordPress 6.3
(WordPress Developer Resources: wp_enqueue_script).
The null version keeps WordPress from adding ?ver= to the address.
Place the component
Section titled “Place the component”In the block editor, add a Custom HTML block and write the component's tag:
<contact-form headline="Ask for a quote"></contact-form>Put the text of the component inside the tag, as children. Text written inside the tag is part of the page's HTML:
<faq-accordion items='[{"question":"Do you deliver on weekends?","answer":"Yes, on Saturdays."}]'> <h2>Do you deliver on weekends?</h2> <p>Yes, on Saturdays.</p></faq-accordion>Compatibility
Section titled “Compatibility”Components on a real WordPress 7.1.4 with the Twenty Twenty-Five and Twenty Twenty-Four themes, and
with Elementor 4.3.5 on Twenty Twenty-Five, in Chromium, Firefox and WebKit, in a Custom HTML block (an HTML
widget in Elementor). The async snippet next to a page's import map, as WordPress prints for its own
blocks, works in the same three browsers. See
Browser and platform compatibility.
Limits
Section titled “Limits”- The Custom HTML block keeps a script tag only for users with the
unfiltered_htmlcapability; that does not matter here, because the script comes fromfunctions.phpand the block holds only the tag. On a multisite, only the Super Admin has the capability (Unfiltered MU). - On WordPress.com, code needs a plan that allows plugins; free sites do not accept it (WordPress.com Support: code).
- Page caches and optimizers that combine or delay scripts can change when the snippet runs. The loader waits for the page to finish parsing before it loads anything, so it does not break the page's own import map.
Common problems
Section titled “Common problems”- The component does not appear. Open the page source and look for the snippet's script tag. A cache plugin may serve the old page: clear it. The tag in the block must be written exactly as the component names it, with a hyphen.
- A block shows the tag as text. The tag was typed in a paragraph block, not in Custom HTML.