Accordions are a tidy way to fit a lot of content on a page without overwhelming the reader. Each section shows only a short line until a visitor clicks it, which makes them a good fit for FAQs, product details, or long instructions where most readers only need one part.
I have hundreds of accordions spread across this site, and they’re a godsend for keeping my inbox from overflowing with support requests about common problems. You can see one in action on the page for my Endpaper plugin.
WordPress has two blocks for this: the Accordion block and the Details block. They look alike, but they’re built differently and suit different jobs. In this tutorial, I’ll go through when to use which, and how to add both.
Accordion or Details?
The Accordion block is a group of sections, each with a heading that opens and closes the content below it. Since the headings are real headings, they become part of the page’s structure, so screen readers can jump between them and search engines see them as headings. That makes it the better choice for an FAQ or anything else with several sections that belong together.
The Details block is a single collapsible item with a summary line that isn’t a heading. It uses the browser’s built-in details element, so it works even if JavaScript doesn’t load, and it doesn’t add anything to the page’s heading structure. That makes it the better choice for a one-off: a spoiler, a long technical aside, or the answer to a single question in the middle of a post.
In short: several sections that belong together, use the Accordion block. One thing to tuck away, use the Details block.
It’s worth deciding before you start, since WordPress currently can’t turn Details blocks into an Accordion block, or the other way around. Switching later means rebuilding the sections by hand.
How to add an accordion
- Add an Accordion block where you want it. You can find it in the block inserter, or type
/accordionin an empty paragraph and press Enter. - Type the heading of the first section in the “Accordion title” field, then add the content in the panel below it. The panel can hold any blocks, not just text.
- Click “Add item” in the block toolbar to add the next section, and repeat until you have all the sections you need.
- Check the heading level. The section headings are H3 by default, which fits below an H2 like the ones in this tutorial. If your accordion sits directly under the page title or under an H3, change the level with the H3 button in the block toolbar.

Here’s what an accordion looks like with the styles of this site:
A set of collapsible sections, where each heading opens and closes the content below it.
Yes, by default. Turn on “Auto-close” in the block settings, and opening one section closes the others.
With the Accordion block selected, the block settings in the sidebar let you change how it works. “Auto-close” closes the other sections when a visitor opens one, which keeps long accordions from growing out of hand. It can result in unexpected content shifts for the visitor, so I usually steer clear of that setting.
You can also hide the plus icon next to the headings, or move it to the left. To have a section open when the page loads, select it and turn on “Open by default” in its own settings.

How to add a Details block
- Add a Details block where you want it, from the block inserter or by typing
/detailsin an empty paragraph. - Type the summary: the line visitors click to show the rest.
- Add the hidden content below the summary. Like the accordion panels, it can hold any blocks.
What does a Details block look like?
Like this. Click the summary again to hide it.
The Details block has an “Open by default” setting as well. And if you want a few Details blocks to behave like an accordion without headings, give them the same value in the “Name attribute” field under “Advanced” in the block settings. The browser then makes sure only one of them is open at a time.

How to change the way they look
How accordions and Details blocks look depends on your theme. For a single block, you can change its colors, typography, spacing and border in the block settings in the sidebar.
To change all of them at once, go to “Appearance” → “Editor” → “Styles” → “Blocks”. The Accordion block is listed there together with its parts: Accordion Item, Accordion Heading and Accordion Panel. To change how the section headings look everywhere, for example, select “Accordion Heading” rather than “Accordion”. The Details block has its own entry in the same list.
The Details block is a little plainer out of the box. The triangle next to the summary comes from the browser, and nothing happens when you hover over it, while the Accordion block has a plus icon and underlines its headings on hover. This CSS gives the Details block the same treatment:
.wp-block-details summary { list-style: none;}.wp-block-details summary::-webkit-details-marker { display: none;}.wp-block-details summary::before { content: "+"; content: "+" / ""; display: inline-block; width: 1.2em;}.wp-block-details[open] summary::before { content: "−"; content: "−" / "";}.wp-block-details summary:hover { text-decoration: underline;}
The two content lines for each icon aren’t a mistake. The second one gives the icon an empty alternative text, so screen readers read only the summary instead of announcing “plus” before it. Browsers that don’t understand that syntax skip the second line and use the first one instead.
You can add it under “Additional CSS” in the Site Editor, which I go through in my tutorial on adding custom CSS in a WordPress block theme.
Things to keep in mind
Don’t hide content that most readers need. Collapsed content is still in the page, so search engines can read it, but visitors have to know it’s there and click to see it. If almost everyone will open a section anyway, it’s better left open as regular text.
Keep the headings and summaries specific, too. “Shipping to Sweden” tells a visitor whether to click. “More information” doesn’t.