Automatic FAQ Toggle

Turn Yoast SEO FAQ blocks into collapsible toggles with no JavaScript.

Lauren Gray Avatar

Automatic FAQ Toggle turns Yoast SEO FAQ blocks into collapsible toggles. Each question becomes a clickable heading that opens its answer. It uses plain HTML (<details> and <summary>), so there’s no JavaScript, and the answers stay in the page’s HTML.

Before you start

  • WordPress 5.8 or later
  • PHP 5.6 or later
  • Yoast SEO, with its FAQ block. That’s the only block this plugin changes.

Install

  1. In your WordPress dashboard, go to Plugins → Add New Plugin.
  2. Click Upload Plugin.
  3. Choose the plugin zip file.
  4. Click Install Now.
  5. Click Activate.

That’s it. Once the plugin is active, every Yoast FAQ block on your site shows as toggles on the front end.

How to use

Turn toggles on or off for one FAQ block

  1. Open a post or page in the block editor and select a Yoast FAQ block.
  2. In the block sidebar, open the Automatic FAQ Toggle panel.
  3. Turn Enable Conversion on or off.
  4. Update the post.

The block setting takes priority over the site-wide setting. That way you can turn toggles off everywhere and turn them back on for one block, or the other way around.

Change the site-wide settings

  1. Go to Settings → Automatic FAQ Toggle.
  2. Check or uncheck Disable Conversion and Default Open.
  3. Click Save Changes.

Settings

Settings → Automatic FAQ Toggle

  • Disable Conversion: turns toggles off for every FAQ block on the site, except blocks where you’ve set Enable Conversion yourself. Unchecked by default.
  • Default Open: toggles start open when the page loads, and readers can close them. Unchecked by default (toggles start closed).

FAQ block panel

  • Enable Conversion: turns toggles on or off for this block. Until you change it, the block follows the site-wide Disable Conversion setting.

Customize with CSS

The toggles come with simple default styles: a light background, rounded corners and an arrow that flips when the toggle opens. To change them, set these CSS variables on .schema-faq-section:

  • Section: --aft--section--color, --aft--section--background, --aft--section--border-radius, --aft--section--margin, --aft--section--contrast
  • Question bar: --aft--summary--padding, --aft--summary--gap, --aft--summary--color, --aft--summary--background, --aft--summary--border-radius
  • Arrow icon: --aft--icon--size, --aft--icon--background-color, --aft--icon--image, --aft--icon--open--image, --aft--icon--open--transform
  • Question heading: --aft--question--margin
  • Answer: --aft--answer--margin, --aft--answer--padding, --aft--answer--color, --aft--answer--background, --aft--answer--border-radius
.schema-faq-section {
	--aft--summary--color: white;
	--aft--summary--background: black;
	--aft--summary--border-radius: 8px;
	--aft--icon--background-color: white;
	--aft--answer--color: black;
	--aft--answer--background: white;
	--aft--answer--margin: 1em 0 0;
	--aft--answer--padding: 2em;
	--aft--answer--border-radius: 8px;
}

Some of these default to your theme’s preset colors, spacing and radius when the theme provides them.

Developer reference

Coming soon: the hooks, filters and functions you can use with this plugin from your theme or a code snippet.

FAQs

Does this change the FAQ in the editor?

No. The FAQ block looks and edits the same as before. The toggles only show on the front end.

Will search engines still see my answers?

Yes. The answers stay in the page’s HTML inside standard <details> elements, which search engines read even when they’re collapsed.

What heading level do the questions use?

Each converted question is an H3. There’s no setting to change it yet.