Categories
Elementor

Accordion Expand All in Elementor: A How-To Guide

You're usually looking for this feature at the exact moment Elementor's default accordion starts getting in the way. The page is built. The layout looks fine. Then you preview a long FAQ, product spec list, policy page, or help center and realize visitors have to keep tapping one item at a time just to read basic information.

That friction adds up fast. On mobile, it's worse. Users don't want to hunt through a stack of collapsed panels when they're trying to compare features, check shipping details, or confirm whether your service fits their situation. They want one obvious control that says “show me everything.”

That's where accordion expand all stops being a nice extra and becomes a practical UX decision. The easiest route is a plugin that handles the behavior cleanly. The harder route is custom JavaScript. Both work. Only one is usually worth the maintenance.

Why Your Elementor Accordion Needs an Expand All Button

A dense accordion without a global toggle creates a simple problem. Visitors can see there's information on the page, but they can't scan it efficiently.

That's common on Elementor builds with long FAQs, pricing breakdowns, onboarding steps, feature comparisons, or documentation sections. A user lands on the page, opens one item, reads a little, closes it by accident, opens another, and loses context. On desktop that's annoying. On mobile it's often enough to make people leave.

What users run into on real pages

The most frustrating accordion pages usually share the same traits:

  • Too many hidden answers: A FAQ with many collapsed items feels longer than it is.
  • High intent visitors: People checking refund terms, product details, or service requirements don't want friction.
  • Weak scanning: If every answer is hidden, users can't skim and compare.
  • Repeated taps on mobile: Simple interactions start feeling like work in these scenarios.

The pattern became more important during the mobile-first shift around 2018 to 2020, and benchmarks cited in this accordion expand and collapse analysis note that adding expand or collapse all controls can reduce bounce rates by 15-22% on content-heavy pages.

A good accordion hides complexity. A bad accordion hides answers.

The real job of an expand all control

An expand all button doesn't replace good information architecture. It gives users control over how they want to read.

Some visitors prefer the compact default view. Others want the whole page open so they can scroll naturally, use browser find, or compare several answers at once. That second group is usually who notices when the feature is missing.

Here's the practical rule I use:

Page type Add expand all?
Short FAQ with a few items Usually no
Product details with many sections Yes
Help center or policy content Yes
Comparison-heavy service page Yes
Marketing accordion used for simple visual reveal Maybe

Where this matters most in Elementor

Elementor's native accordion is fine for straightforward disclosure content. It's less fine when the page carries decision-making content. That's the gap most site owners run into. They don't need a clever workaround. They need a reliable control that users immediately understand.

The Code-Free Method with Exclusive Addons

If your goal is to ship this quickly and avoid debugging, use a widget that already supports the behavior. That's the professional choice in most client builds.

Core Elementor doesn't offer a native “all expanded on load” option. That gap is documented in Elementor's own accordion widget documentation, and it's one reason plugin-based solutions are popular with the 60,000+ users looking for a code-free approach.

Why this route is usually better

The plugin route wins on three things: speed, consistency, and maintainability.

Instead of wiring up custom selectors, click handlers, state classes, and responsive edge cases yourself, you work with a widget that already exposes the feature in the editor. That matters when you're building for clients, handing sites off to content teams, or maintaining multiple Elementor installs.

Screenshot from https://exclusiveaddons.com/widgets/accordion/

A clean setup workflow

Use this workflow when you want the fastest implementation:

  1. Add the accordion widget to your page
    Open the Elementor editor and place the accordion where your FAQ, feature list, or documentation block belongs.

  2. Create your items first
    Finish the content structure before touching the expand/collapse behavior. Label each item clearly so the accordion still makes sense in its collapsed state.

  3. Enable the global toggle option
    In the widget settings, turn on the built-in expand and collapse control. If you're using this widget regularly, keep the official accordion widget documentation handy so you can check option names and behavior details.

  4. Set useful button labels
    “Expand All” and “Collapse All” are usually better than creative copy. They're predictable and don't require interpretation.

  5. Check the responsive preview
    Verify spacing, button placement, and tap area on tablet and mobile before publishing.

Trade-offs worth knowing

This method is faster, but it still needs judgment. A few practical notes:

  • Don't enable it just because you can: If the accordion only has a handful of short items, the button may add clutter.
  • Keep labels literal: Users shouldn't have to guess what the control does.
  • Watch long-page behavior: Expanding everything can make a page feel heavy if the content is poorly organized.

Practical rule: If a client asks for custom JavaScript before checking whether the widget already does it, I test the widget first. Fewer moving parts usually means fewer support tickets later.

For most Elementor sites, this is the right answer. It's quicker to build, easier to hand off, and much less likely to break after a plugin, theme, or editor update.

Building It Manually with Custom JavaScript

Custom code is still an option when you need full control or you're committed to Elementor's default accordion. Just go in knowing what you're trading for that control.

The main risk isn't getting a click event to work. That part is easy. The hard part is keeping the accordion stable when Elementor updates markup, when another script touches the same classes, or when accessibility states stop matching what users see on screen.

A person coding in JavaScript on a computer screen while working at a wooden office desk.

A practical warning comes from this Elementor expand and collapse guide. Custom JS snippets often break ARIA attributes, keyboard navigation, and screen reader announcements, and poorly optimized scripts can cause 20-30% drops in CLS-related performance scores.

A simple approach that works

If you still want the manual route, start with a separate button above the accordion and let JavaScript trigger each accordion header.

Use a button or link with a class like .js-expand-all, then target the Elementor accordion items in the same section or container.

<button class="js-expand-all" type="button">Expand All</button>
<button class="js-collapse-all" type="button">Collapse All</button>
document.addEventListener('DOMContentLoaded', function () {
  const expandBtn = document.querySelector('.js-expand-all');
  const collapseBtn = document.querySelector('.js-collapse-all');
  const accordion = document.querySelector('.elementor-accordion');

  if (!accordion || !expandBtn || !collapseBtn) return;

  const titles = accordion.querySelectorAll('.elementor-tab-title');

  function isExpanded(title) {
    return title.classList.contains('elementor-active') ||
      title.getAttribute('aria-expanded') === 'true';
  }

  function clickIfNeeded(title, shouldExpand) {
    const expanded = isExpanded(title);
    if (shouldExpand && !expanded) title.click();
    if (!shouldExpand && expanded) title.click();
  }

  expandBtn.addEventListener('click', function () {
    titles.forEach(function (title) {
      clickIfNeeded(title, true);
    });
  });

  collapseBtn.addEventListener('click', function () {
    titles.forEach(function (title) {
      clickIfNeeded(title, false);
    });
  });
});

Where to place the script

You have a few workable options:

  • Elementor Custom Code: Good if you want page-level control without editing theme files.
  • A child theme script file: Better if this behavior is part of the site's long-term front-end setup.
  • Code snippets plugin: Fine for quick deployment, but document it so the next developer knows where it lives.

Keep the script scoped. Don't target every .elementor-accordion on the site unless that's intentional.

What usually breaks first

The first version often works in testing and then fails in production because the page has more than one accordion, AJAX-loaded content, or nested widgets. Scope matters.

A safer pattern is to wrap each button pair and accordion in a shared parent container, then query within that container only. That avoids one button opening every accordion on the page.

Later in the build, it helps to see another implementation in action:

If you build it manually, test it after every Elementor update. Custom selectors age faster than most people expect.

When manual code is justified

Manual JavaScript makes sense when:

  • you need behavior tied to a custom template structure
  • you want to integrate analytics or state persistence
  • you're building a highly customized front-end and already own the codebase

If that isn't your situation, custom code often creates more work than value.

Integrating and Styling Your Toggle Buttons

A working toggle is only half the job. If users can't spot it instantly, they won't use it.

The button should sit directly above the accordion, aligned with the content it controls. Don't bury it in a separate column or place it below the widget. People scan from heading to control to content. Keep the sequence obvious.

Placement that feels natural

In Elementor, the simplest layout is a small wrapper section or container with:

  • a heading
  • the toggle buttons
  • the accordion underneath

If you want a more app-like control style, a dedicated Elementor toggle button widget can help you keep the interaction visually clear without building custom UI from scratch.

A person using a smartphone to interact with a notification settings UI screen featuring toggle switches.

Button labels and targeting

For custom JavaScript setups, assign clear classes:

<div class="accordion-controls">
  <button class="js-expand-all" type="button">Expand All</button>
  <button class="js-collapse-all" type="button">Collapse All</button>
</div>

Keep your labels literal. “Show all answers” can work on FAQ pages, but “Expand All” and “Collapse All” are still the clearest pair in most builds.

CSS that improves usability

You don't need a big styling system here. You need controls that are easy to identify, easy to tap, and visually tied to the accordion.

.accordion-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.accordion-controls button {
  border: 1px solid #7a56ff;
  background: #fff;
  color: #7a56ff;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accordion-controls button:hover,
.accordion-controls button:focus {
  background: #7a56ff;
  color: #fff;
  outline: none;
}

.accordion-controls button:focus-visible {
  box-shadow: 0 0 0 3px rgba(122, 86, 255, 0.2);
}

Design choices that hold up on client sites

A few choices consistently work better than decorative styling:

UI choice Better option
Tiny buttons Medium tap targets
Low-contrast outline Clear contrast between text and background
Clever copy Direct labels
Isolated control Place it immediately above the accordion

The control should look like part of the accordion system, not like an unrelated CTA button dropped into the layout.

If the rest of the design uses icons, you can add plus and minus symbols. Just don't rely on icons alone. Text still carries the interaction.

Ensuring Full Accessibility and Responsiveness

Many accordion expand all implementations fail at this point. The interaction works visually, but the page becomes worse for keyboard users, screen readers, and mobile visitors.

That's not a minor technical flaw. It changes who can use the page.

Nielsen Norman Group findings in this accordion usability research note that an Expand All button can increase content visibility by 22%, and pages in A/B tests saw a 14.71% increase in scroll depth when the feature was present. Those gains only matter if the implementation remains usable for everyone.

The accessibility checks that matter most

When you add a global accordion control, check these items manually:

  • Keyboard flow: Users should be able to tab to the button, activate it, then continue through the accordion headers naturally.
  • ARIA state updates: The visible state and the aria-expanded state must stay in sync.
  • Focus visibility: Buttons and accordion headers need a clear focus indicator.
  • Semantic controls: Use real <button> elements for the toggles, not styled <div> elements.
  • Screen reader clarity: Button text should state the action plainly.

A checklist infographic titled Accessibility and Responsiveness containing eight essential web development tips for improving digital usability.

If you work with smaller organizations that don't have in-house accessibility expertise, this guide on accessible web design for small businesses is a useful companion because it frames accessibility as part of real-world site ownership, not a separate compliance exercise.

Responsive behavior needs explicit testing

Responsive accordion behavior doesn't take care of itself. Test the actual interaction on mobile, not just the layout preview.

Check for these common failures:

  1. Buttons too close together
    Side-by-side controls can become awkward on narrow screens. Let them wrap.

  2. Layout shift on expand
    If content jumps aggressively when panels open, the page feels unstable.

  3. Nested spacing problems
    Long answers with lists, images, or tables often break the mobile rhythm.

  4. Hidden focus states
    Some themes remove button outlines, which makes keyboard use much harder.

A practical review process

Before shipping, run this short checklist:

  • activate the toggle using only the keyboard
  • test with more than one accordion on the page
  • inspect whether ARIA states change correctly
  • open the page on a phone and test actual tap behavior
  • print preview the page if the accordion contains reference content

For a broader audit process, a dedicated website accessibility checklist for Elementor sites helps teams verify the basics before handoff.

Accessibility work doesn't slow a project down. Fixing broken interactions after launch does.

Troubleshooting Common Accordion Toggle Issues

Most accordion problems come from one of three things: the selector is wrong, the script is loading at the wrong time, or another plugin is touching the same markup.

When you troubleshoot, don't change five things at once. Check one layer at a time. Start with markup, then events, then CSS, then conflicts.

The button does nothing

If the toggle button renders but doesn't trigger anything, the usual cause is a selector mismatch.

Run through this list:

  • Check the accordion wrapper: Confirm the page uses the class your script expects.
  • Inspect the button classes: A typo in .js-expand-all is enough to break the whole interaction.
  • Test after load: Elementor widgets may render after your script if you attach code too early.
  • Scope correctly: If the page has multiple accordions, the script may be targeting the wrong one.

A quick browser console test helps. Select the accordion wrapper manually and verify the returned element before touching the logic.

Everything opens, but accessibility states are wrong

This is one of the most common custom-code failures. The panel may appear open, but the ARIA state doesn't match. Keyboard users and screen readers get bad information.

Fix that by triggering the existing accordion control rather than force-applying visual classes. In practice, that means clicking the actual header button instead of manually adding elementor-active with JavaScript.

Don't fake accordion state with CSS classes alone. Let the widget's own interaction update the state.

The page flashes open on load

This is the classic FOUC problem. Accordion panels appear briefly expanded before JavaScript finishes collapsing them.

The fix usually involves one of these:

  • Load behavior earlier: Move the script so it runs before visible interaction begins.
  • Use a CSS baseline: Keep panels visually collapsed by default.
  • Avoid conflicting scripts: Another script may be expanding panels before yours runs.

If you're intentionally opening all items by default, make sure that state is set consistently. Partial initialization is what causes the flash.

Print and analytics get overlooked

Two common misses show up after launch, not during initial development. The first is analytics. The second is print behavior.

The UX Patterns benchmarks summarized in this accordion tracking and behavior reference note that 35% of custom implementations ignore viewport entry tracking, which means teams miss visibility insights. The same source notes that 40% of accordions fail to auto-expand on print, leading users to abandon printing in 15% of cases.

That matters on policy pages, documentation, onboarding guides, and support content.

A practical print override looks like this:

@media print {
  .elementor-tab-content {
    display: block !important;
  }
}

Theme and plugin conflicts

If the accordion works in a default theme but breaks in production, test for conflicts methodically:

Symptom Likely cause First fix
Button click ignored JS conflict or missing selector Inspect classes and console errors
Panels open incorrectly Multiple scripts managing state Disable one script path
Styling looks broken Theme CSS override Inspect cascade and increase specificity
Mobile feels jumpy Transition or height animation issue Simplify animation behavior

Bookmark your working version before making changes. Accordion bugs are easier to solve when you can compare against a known-good state.


If you'd rather skip the selector debugging, accessibility cleanup, and update-related maintenance, use Exclusive Addons and handle accordion expand all with a widget built for Elementor instead of patching it in later.