Home » Web Tutorials » WordPress » How to Add Accordion Style FAQ in WordPress?

How to Add Accordion Style FAQ in WordPress?

WordPress version 6.9 was released with lot of features and accordion block is one of the notable additions to the Gutenberg editor. Now, you can easily create FAQ in accordion style without any third-party apps. This is also an easy way to show your long content in small space.

Accordion Block in WordPress

There are two simple requirements for using this block:

  • You should be using the Gutenberg editor and not the old Classic editor. This means, you can’t use this block with WooCommerce and other custom plugins still using the old editor interface.
  • Update your WordPress to version 6.9 or later.

Creating FAQ with Accordion Block

  • Create or edit a post in Gutenberg editor.
  • Search and insert an “Accordion” block where you want to show the FAQ section.
  • The block has a heading where you can type your question and a panel where you can type your answer. You can insert any other content like images or buttons in the panel area.
  • After creating the first Q & A item, select the parent block (Accordion Item in List View), click on the “Options” and select “Duplicate” option to add another item.
  • Create as any as items and fill all your Q & A details.
Duplicate Accordion Section
Duplicate Accordion Section

Note: You can also use the Accordion Group block for inserting two sections as a block.

Styling Your FAQ

The block, individual headings and panel sections can be customized from the block’s sidebar settings. We recommend using the List View panel from Document Overview section to easily select the required item when you have lot of Q & A sections. The entire Accordion block has four sections as explained below. Each part can be selected from List View and customized using the settings / styles from the sidebar.

  • Accordion – selecting this parent block allows you to change the heading and add new item using the block tools. Under “Settings” tab, toggle auto-close to automatically close one section when another section is opened and toggle the icon. You can also move the icons (+ or x) to the left or right side as you need. Adjust the font style, paddings / margins, borders and upload an background image under “Styles” section.
  • Accordion Item – turn on “Open by default” option to show the section opened when the page loads. You can also customizable the fonts, colors and spacing.
  • Accordion Heading – customize the heading styles.
  • According Panel – By default, it includes a paragraph block, you can add any other block and customize the styles as you need.
Customize Block Settings
Customize Block Settings
Customize Block Style
Customize Block Style

Simply select the “Accordion Item” on the List View panel and drag up or down to rearrange its position. In this way, you can first create the entire FAQ section and then change the order of the questions without deleting / recreating the sections.

Note: If required, create the customized Accordion block as a pattern and reuse it throughout your site.

Example FAQ with Accordion

Below is an example of a FAQ section created with the Gutenberg Accordion block. You can play with the colors and fonts to match other elements on your page.

Example FAQ
Example FAQ

To show the difference, below is the live FAQ section created with Yoast FAQ block and customized with borders / paddings (above is the image and below is the live content to avoid duplication).

1. What is accordion?

An accordion in website content is a collapsible section that expands when clicked to reveal additional information.

2. Do I need a plugin to use the block?

No, Accordion is the default block that comes with Gutenberg editor from WordPress version 6.9.

3. Can I customize the Accordion block?

Yes, you can change the typography, add background image and adjust spacing with the default block settings.

4. Are there any issues with the block?

The block does not integrate schema like FAQ block offered by the SEO plugins.

Potential Improvements

The default Accordion block does not have the FAQ schema integration. This may prevent search engines from understanding the content compared to the pages with proper FAQ schema. As shown above, you can easily add FAQ with schema using any popular SEO plugins like Yoast or Rank Math. So, there is no point of using Accordion block and losing that feature.

You may also face issue with plugins like Table of Contents, which process the headings on a page. Currently, the block uses H1 to H6 heading and there are no options to use div, span or paragraph. This will create problems when you process the headings with plugins like creating table of contents. You table of content will show all the headings from the accordion block. The best possibility at this point is to change the heading to H6 (and adjust the font size as you need) and exclude H6 from your table of content plugin or block setup.

WordPress 6.9 loads separate block styles as an inline CSS in the header. In addition, Accordion block will use the script for interactivity. These styles and scripts can easily mess up with your theme’s styles. So, you may need the developer’s help to make it work if it is not working on your site.

Final Words

Though there are lot of improvements needed, Accordion block is definitely a good addition for creating a compact content. You can insert FAQ anywhere and style as per the page layout. You can also soon expect plugin / theme developers or WordPress core will start integrating schema with the block making it perfect.

Leave a Comment

Your email address will not be published. Required fields are marked *