Elementor Open Tab on Link Click: Tabs, Accordion & Toggle (No Plugin)

elementor open tab on link click

Quick answer: To make Elementor open tab on link click, give the tab or accordion title an ID, link to it with #your-id, and add the small JavaScript below to the page. When someone opens example.com/page/#your-id or clicks a #your-id link on the same page, the script opens that item and scrolls to it. No plugin is needed.

Elementor open tab on link click

I use this on client sites for FAQ pages, pricing tabs and “read the details” buttons, where a link should land the visitor on the exact answer instead of a closed list.

Step 1: Give each title an ID

New nested Tabs or Accordion widget: open the item, go to the item settings and fill in the CSS ID field, for example shipping. Use lowercase letters and hyphens only.

Classic Tabs, Accordion or Toggle widget: these have no ID field, so put an empty span with an ID inside the title text:

Title field
u003cspan id=u0022shippingu0022u003eu003c/spanu003eShipping and delivery

Every ID on the page must be unique.

Paste this into Elementor > Custom Code (set it to load in the body end), into an HTML widget on the page, or into your theme footer. It has no jQuery dependency. The CSS ID field is described in Elementor’s help center.

open-elementor-tab.js
/* Open an Elementor tab, accordion or toggle from a link or #hash in the URL.n   Works with the classic widgets and the newer nested Tabs/Accordion. */ndocument.addEventListener('DOMContentLoaded', function () {n  var OFFSET = 120; // space above the opened item, e.g. your sticky header heightn  var TITLES = '[role=u0022tabu0022], summary, .elementor-tab-title, .e-n-tab-title, .e-n-accordion-item-title';nn  function openTarget(id) {n    var el = id u0026u0026 document.getElementById(id);n    if (!el) return false;n    var title = el.closest(TITLES) || el.querySelector(TITLES);n    if (!title) return false;nn    var isOpen = title.getAttribute('aria-expanded') === 'true' ||n                 title.getAttribute('aria-selected') === 'true' ||n                 (title.tagName === 'SUMMARY' u0026u0026 title.parentElement.open);n    if (!isOpen) title.click();nn    // Wait for the open animation, then scroll so the title sits below the header.n    setTimeout(function () {n      var top = title.getBoundingClientRect().top + window.pageYOffset - OFFSET;n      window.scrollTo({ top: top, behavior: 'smooth' });n    }, 400);n    return true;n  }nn  // 1. The page was opened with a hash, e.g. example.com/faq/#shippingn  if (location.hash) openTarget(decodeURIComponent(location.hash.slice(1)));nn  // 2. A link on the same page was clicked, e.g. u003ca href=u0022#shippingu0022u003en  document.addEventListener('click', function (e) {n    var a = e.target.closest('a[href*=u0022#u0022]');n    if (!a || a.host !== location.host || a.pathname !== location.pathname) return;n    var id = decodeURIComponent(a.hash.slice(1));n    if (openTarget(id)) {n      e.preventDefault();n      history.replaceState(null, '', '#' + id);n    }n  });n});

Link to the ID from anywhere: a button, a menu item or another page. For example https://yoursite.com/faq/#shipping or simply #shipping on the same page.

How the script works

  • It finds the element with the ID from the link and walks up to the clickable tab or accordion title.
  • If the item is closed, it clicks the title so Elementor opens it with its own animation.
  • After 400 ms (the default open animation) it scrolls the title into view, leaving OFFSET pixels free for a sticky header.
  • Same-page links are handled without reloading, and the URL hash is updated so the link can be shared.

Troubleshooting

  • The page scrolls but nothing opens: check that the ID is inside the title, not inside the content area.
  • The title is hidden under the header: increase OFFSET to your header height plus a little space.
  • The scroll lands in the wrong place: if you slowed the open animation in Elementor, raise 400 to match it.
  • Two items open at once on mobile: classic widgets duplicate titles for mobile, so keep each ID in one title only.

Need this set up on your own site, or a whole page built? Hire an Elementor developer and get it done without touching code.

Frequently asked questions

How do I open a specific Elementor tab from a link?

Give the tab title an ID, add the small script from this guide, then link to #your-id. The script opens the matching tab and scrolls to it.

Does this work for Elementor accordions and toggles?

Yes. The same script works for tabs, accordions and toggles, in both the classic widgets and the newer nested Tabs and Accordion widgets.

Can I link to an Elementor tab from another page?

Yes. Use the full URL with the ID at the end, for example https://example.com/faq/#shipping. The script opens the tab when the page loads.

Tanvir Hossain Tofan, WordPress developer

Written by Tanvir Hossain Tofan

WordPress & Shopify developer from Bangladesh with 5+ years of experience building custom ACF themes, Elementor sites, plugins and Shopify stores for clients worldwide. Author of the Toofan Stage-to-Live Sync and Talkvara AI Chatbot plugins on WordPress.org.

See my work · Hire me · WhatsApp · YouTube · LinkedIn

Previous Post

Elementor Loop Grid Order By ACF Date Field (Upcoming Events First)

Quick answer: For an Elementor Loop Grid order by ...

Next Post

jQuery Tabs Next Prev Button: Step-by-Step Form with Bootstrap Tabs

Add Next and Previous buttons to Bootstrap tabs wi ...

If you find it useful

Buy me a coffee

ACF

Blog

Elementor

HTML JQuery

PHP

Tips & Tricks

WordPress

Elementor Loop Grid Order By ACF Date Field (Upcoming Events First)

Quick answer: For an Elementor Loop Grid order by ...

Figma to Elementor: How to Convert a Figma Design Step by Step

My Figma to Elementor workflow in 7 steps: globals ...

Back to top