How to Fix Elementor's "You Must Call the Content Function" Error

Rifat Elementor Nov 13, 2022

If you use Elementor, you may occasionally see errors that are unique to this page builder plugin. The Elementor error "you must call the content function" is one of them. This statement is especially annoying because it can prevent you from using the page builder. The "content function" error in Elementor usually happens when you try to change a page that the default builder doesn't support. This simplifies diagnosing the mistake unless it occurs on every page. Once you've identified the issue, it's simple to resolve. This article will explain the cause of the "you must call the content function" error in Elementor. In addition, we will demonstrate how to resolve the issue. Let's get to it!

Concept of Elementor Error "You must Call the Content Function"

This is the complete error message displayed when the "you must call the content function" problem occurs:

"The content section could not be located on your page. The 'the content' function must be called in the current template for Elementor to function on this page." The absence of the WordPress content function suggests that there may be a problem with your current theme. However, this feature is not exclusive to Elementor-friendly themes, as it is created to display the post's content:

Screenshot of the Elementor content error message

This indicates that there are multiple additional possible causes for the Elementor error "you must call the content function." Most likely, you are attempting to edit WordPress content that Elementor does not natively support. This could occur, for instance, if you attempt to alter product pages, which cannot be modified with the free version of the plugin. Occasionally, the problem in question can be caused by caching issues. When this occurs, clearing your browser's cache should resolve the issue within minutes. In light of this, we will concentrate on how to troubleshoot the more difficult scenarios that can result in this problem.

Create Amazing Websites

With the best free page builder Elementor

Start Now

How to Fix Elementor's "You Must Call the Content Function" Error

We have come to know a little more about the “you must call the content function” error, Let's discuss a couple of instances where this may occur and how to overcome it.

Utilize the Theme Builder to Modify Archive Pages

The Elementor free edition does not feature the Theme Builder tool. In case you are unfamiliar, Elementor's Theme Builder functions similarly to WordPress's full-site editor. Using this tool, you can edit theme templates like you would conventional web pages. If you try to use the Elementor editor as usual when editing blog archive pages, you may see the message "You must call the content function." If you have a license for Elementor Pro, you can quickly remedy this issue.
Go to Templates > Theme Builder and then choose the template you want to change on the next page:

After picking a template, the Elementor editor will appear, allowing you to make modifications as usual. In addition, you will have access to a library of pre-built designs for theme templates:

pre built elementor themes and blocks

Usage of Theme Builder to Modify Product Page Content

If you attempt to change individual product pages in Elementor, the WooCommerce "product" custom post type may generate a content function error. Because the Elementor free version does not support product page modifications.  If you wish to integrate WooCommerce with Elementor, a Pro license is required. After activating the premium edition of Elementor, you will be able to alter product and shop page templates using its Theme Builder. Go to Templates > Theme Builder to access the Theme Builder.  The premium edition of Elementor should not include any presets for product pages by default. Nevertheless, you have access to Elementor templates that you may import and utilize on your website:

Elementor blocks and templates

Similarly to blog archive pages, you will be able to modify every design element of product templates using the Elementor editor. The main distinction lies in how the Elementor editor is accessed.

Ensure that you are not reusing page slugs

Reusing WordPress page slugs is one little issue that can cause the "you must call the content function" notice in Elementor. By default, WordPress does not let numerous blog posts or pages share the same slug. However, you may be able to use identical slugs for page, product, and post categories. This condition can lead to confusion regarding WordPress permalinks. If this occurs, the Elementor page builder may assume you're attempting to change a product page or other template that requires the Theme Builder.

To avoid this, stop reusing slugs across several element types. Remember that you can easily modify the slug of any page using the Block Editor.

Include the content Function in Your Custom Page Template

As indicated by the error message, the "you must call the content function" Elementor problem can be triggered by using a template that lacks the WordPress content function. Switching to a default option, such as Twenty Twenty-One or Twenty Twenty-Two, is a quick approach to determine if your WordPress theme is generating the error. If switching themes resolves the Elementor content function problem, you can guess that the content function was absent from the prior template.

At this point, you have the option of permanently switching themes or merely editing the page template that prompted the problem. Keep in mind that securely updating page templates involves an understanding of theme development, fundamental PHP, and code review. Typically, you'll need to modify either the page.html or single.html template files within the theme you're employing. Typically, you may locate these files by heading to the wp-content/themes directory and identifying the folder for your active theme. Once inside, look for the folder labeled "templates":

Search for the templates folder

Then, open the file you wish to edit and verify that the following function is present:

<?php the_content(); ?>

If it does not, you must manually add the function. However, proceed with caution, as adding methods to a page template will alter its appearance and functionality. We recommend working with a WordPress developer if you are uncertain about the process.

Final Analysis

If you get the "you must call the content function" error in Elementor, you might not be able to use the page builder to change a certain page (or even multiple pages). Most of the time, you'll get this WordPress error when you try to change page templates that the free version of Elementor doesn't let you change. But if you have a pro license, you can easily fix this by making small changes, such as editing your blog archive pages or product pages.

Divi WordPress Theme