How We Built an Elementor Nested Widget With Drag-and-Drop Content Areas

16 min read
Illustration of a custom Elementor widget interface with flexible drag-and-drop content areas and repeated layout blocks.

Elementor is powerful because it gives website owners a visual way to build pages. You can add sections, move content around, change layouts, and create professional pages without touching code.

But sometimes, a standard Elementor widget is not flexible enough. That is when a custom Elementor nested widget can be a better solution.

In one of our custom Elementor projects, we needed to build an Elementor nested widget where each repeated item could become its own editable content area. In simple words, the user could add several tabs, slides, pages, or sections — and inside each one, they could drag any Elementor widget they wanted.

That may sound simple from the outside, but technically it is very different from a normal Elementor repeater.

A standard repeater usually lets users repeat fixed fields. For example, you can create a list where every item has a title, text, image, and button. That works well for many websites.

But in our case, fixed fields were too limited. We did not want to decide in advance what the user could place inside each item. We wanted each item to act like a small Elementor canvas.

So instead of this:

Item 1: Title + Text + Button
Item 2: Title + Text + Button
Item 3: Title + Text + Button

we needed this:

Item 1: Full Elementor drop zone
Item 2: Full Elementor drop zone
Item 3: Full Elementor drop zone

That means the user can add headings, images, videos, icons, buttons, columns, forms, or any other Elementor widget inside each repeated item.

This gives much more freedom.

Why This Matters for Real Websites

For agencies, developers, and business owners, this type of Elementor nested widget can be very useful.

Many websites need repeatable structures, but the content inside those structures is not always the same. For example, a company website may need advanced tabs where every tab has a different layout. One tab may include text and icons. Another tab may include a video. Another may include a pricing block or a contact form.

The same idea can be used for:

  • advanced tabs
  • accordions
  • carousel slides
  • multi-step layouts
  • product sections
  • landing page blocks
  • paginated content
  • custom service sections
  • onboarding or process layouts

With a normal widget, the layout is often too fixed. With a nested Elementor widget, the structure is controlled, but the content remains flexible.

That is a strong combination.

The designer or developer can create the overall experience. The website owner or editor can still manage the content visually inside Elementor.

The Problem With Standard Repeaters

Elementor repeaters are useful, but they are usually field-based.

You define the controls, and users fill them in. For example:

  • title
  • description
  • image
  • link
  • icon

This is fine when every repeated item follows the same layout.

But it becomes a problem when each item needs a different design. You can keep adding more fields, but the widget quickly becomes complicated. You end up with too many options, too many conditions, and a user experience that feels heavy.

At some point, it is better to stop forcing everything into fields and allow users to build the content visually.

That was the reason we started researching a nested widget solution.

What We Needed to Build

The goal was simple from the user’s point of view.

The user adds a custom widget to the page. Inside that widget, they can add multiple items. Each item appears as part of the widget interface, for example as a tab, page, slide, or step.

But each item is also a drop zone.

So when the user opens the first item, they can drag Elementor widgets inside it. Then they can open the second item and add completely different content there.

Behind the scenes, every repeater item needs to be connected to a child container.

This connection is the key part.

When the user adds a new repeater item, Elementor also needs to create a new child container. When the user removes an item, the connected container also needs to be removed. The repeater items and child containers must stay in sync.

In simple terms:

Repeater Item 1 = Drop Zone 1
Repeater Item 2 = Drop Zone 2
Repeater Item 3 = Drop Zone 3

That one-to-one relationship is what makes the Elementor nested widget work.

The Technical Challenge

Elementor has good documentation for standard custom widgets. If you want to create a normal widget, you extend the standard widget base class, register controls, render the output, and add the widget to Elementor.

But this project needed something more advanced.

We could not find clear official public developer documentation for this exact third-party nested widget pattern. So our developer researched Elementor’s own plugin code and tested the approach directly in a production environment.

The final solution required three main parts:

  1. a PHP widget class
  2. a small editor JavaScript file
  3. proper widget and script registration

Missing any of these parts can break the widget.

The PHP class defines the widget structure, controls, default child containers, and frontend output. The JavaScript file tells the Elementor editor that this widget supports nested elements. The registration step makes sure both the widget and the editor script are loaded correctly.

How the Elementor Nested Widget Works

A custom nested Elementor widget does not work exactly like a standard widget.

A normal custom widget usually extends Elementor’s standard widget base class. A nested widget uses Elementor’s nested elements infrastructure instead.

The important idea is that the widget must define default child containers. These are the editable areas that appear when the widget is first added to the page.

For example, if the widget starts with three default repeater items, it also needs three default child containers.

If those numbers do not match, the widget can behave incorrectly from the start.

The widget also needs to tell Elementor where these child containers should appear inside the HTML. This is done with a placeholder selector. That selector must match a real, empty element in the widget output. Elementor then injects the child containers into that area inside the editor.

This is one of the most important details.

If the placeholder is wrong, the drop zones will not appear where they should. If the placeholder is not empty in the editor template, Elementor may not be able to place the child containers correctly.

Why the Editor JavaScript Is Important

One of the easiest parts to miss is the editor JavaScript file.

Even if the PHP class is correct, the Elementor editor still needs to know that the custom widget is a nested element type. Without that registration, Elementor may treat the widget like a normal widget, and the drop zones will not appear.

The JavaScript file is not large. Its main job is to register the custom widget type with Elementor’s nested element system.

The widget name in JavaScript must match the widget name in PHP. If the names are different, the connection fails.

This is a small detail, but it is also one of the most common reasons why the widget does not work.

What We Learned

The main lesson is that advanced page builder work often goes beyond normal theme customization.

Elementor makes editing easier for users, but custom business websites still need proper development behind the scenes. When a project needs flexible content, reusable components, custom layouts, or special editing experiences, a standard widget is not always enough.

In this case, the best solution was not to create a huge widget with many fixed fields. The better solution was to create a controlled structure with flexible content areas inside it.

That gives the client more freedom while still keeping the design organized.

For agencies, this can be especially useful. You can build reusable Elementor components that are easy for clients to manage, but still powerful enough for complex layouts.

For business websites, it can reduce long-term content editing problems. Instead of asking a developer to change every layout variation, the website owner can manage more of the content visually.

When an Elementor Nested Widget Makes Sense

A custom nested Elementor widget is not needed for every project.

If your widget only needs a title, image, and text, a normal repeater is probably enough.

But this approach makes sense when every repeated item may need different content or a different layout.

For example, it is useful when:

  • every tab needs different content
  • each slide needs a custom layout
  • a process section has different types of content in each step
  • the client needs more editing freedom
  • the design needs repeatable structure but flexible inner content
  • the website should stay easy to edit after delivery

It is also useful when you want to give clients flexibility without giving them a completely empty page to manage.

That balance is important.

Too much freedom can create messy pages. Too little freedom can make every change dependent on a developer. A nested widget can sit nicely between those two extremes.

Final Thoughts

This project started with a simple goal: make a custom Elementor nested widget where each repeated item becomes a real drag-and-drop content area.

The final result gives users a much more flexible editing experience. They can add repeatable items, but they are not locked into fixed fields. Each item can contain any Elementor content, while the overall widget structure remains controlled and consistent.

That is the kind of solution we like to build at AnpsThemes.

Good WordPress development is not only about writing code. It is about making websites easier to manage, more flexible for real content, and more useful for the people who work with them every day.

If your website, agency project, or WordPress product needs a custom Elementor widget, advanced theme feature, or a more flexible editing experience, this is exactly the type of custom development work we can help with.

 

Build with a Reliable
WordPress Development Partner

Whether you need a premium theme, custom WordPress development, or a fully managed solution, our team is ready to scale with your business.