Fix the “This file should not be imported in this context” Divi error

Introduction

Have you ever tried to import a JSON file into Divi only to be met with the frustrating notification saying: “This file should not be imported in this context”? Whether you tried to import a free layout from somewhere else or a layout you have exported yourself, this error might have appeared and made quite a snag in your plans.

"This file should not be imported in this context" Divi error
So annoying, right?

But no worries! Today, we’ll tell you exactly why this happens and how to fix it if it does. We’ll also share a nifty little trick that will help you avoid seeing this error ever again! 

And psst! We know how annoying it can be to read a full explanation if all you need is a simple, quick fix. If you want the TL;DR version of our solution, scroll down to the last paragraph.

This file should not be imported in this context: what does it mean?

This statement may be quite confusing, because ‘context’ is a word with quite a broad meaning. Here, it means:

Context – the situation or environment in which a file was exported/imported.

This context can either be the Divi Library, the Divi Builder, or the Theme Builder. So what this error message means is that the file cannot be imported into the environment you’re trying to import it into. For example, if you’re trying to import a JSON file into the Divi Builder and you see this error, it means that you are importing it into the wrong environment.

Why does it matter?

It matters because the Portability functionality works only if you import a file in the same context in which it was exported. For example, if a file was exported using the Divi Library, it can only be imported into the Divi Library. If it was exported from the Divi Builder, it can only be imported into the Divi Builder.

The same principle applies to the Theme Builder. So we have three major contexts in which a layout can be imported or exported.

How to fix the “This file should not be imported in this context” Divi error?

Now, after this brief explanation, we come to the solution, which is: import the layout in the same context in which it was exported. So, if a file was exported using the Divi Library, you can only import it into the Divi Library.

So far so good, right?

But what if you downloaded a layout (for example, this cute About Us page layout for a business couple!) and don’t know how it was exported? Should you just keep trying to import it in different contexts until you find the one that works?

Of course not! That would be quite frustrating, right? Thankfully, there is a shortcut. For one, if you’re using a layout from Divi Lover, it will always come with a brief Read Me PDF file that will tell you in which context the layout should be imported. Most Divi web designers who share free layouts will include this information.

But what if there’s no instruction manual? Are you doomed to use trial and error?

How to never see this error again

Thankfully, no! There’s a simple trick you can use to quickly check what’s the right context for the JSON file you’re trying to import. All you need to do is open the JSON file in a text editor and look at the first line. It will tell you what the correct context is, for example: “context”:”et_builder”, which means that the correct context for this file is the Divi Builder.

A JSON file opened in the Notepad to check the context and fix the "This file should not be imported in this context" Divi error
The first line indicates the proper context for this file.

The other versions you may see are: “et_builder_layouts” which means the context is the Divi Library, and “et_theme_builder” which means the context is the Theme Builder. You might also encounter this: “epanel”, which means what you’re dealing with is a settings file exported from the Divi Theme Options. Another possibility is that you’ll see “et_divi_mods” – a file exported from the Divi Theme Customizer.

So, to recap: if you have a JSON file you’d like to import, and you don’t know in which context it was exported, you can simply open it in a text editor and check the context. All that remains is to import the file in that context.

The quick fix

So, once again, here is the quick, shortened version of the article above and the steps you need to do to never see this error message again:

  1. A layout can only be imported in the same environment (context) in which it was exported.
  2. To check the context, open the JSON file in a text editor and look at the first line. It will tell you the appropriate context in which you can import the file.

Context options:

  • “et_builder_layouts” – Divi layouts exported from the Divi Library
  • “et_builder” – page layout exported from the Divi Builder
  • “et_theme_builder” – TB layouts exported from the Theme Builder
  • “epanel” – settings file exported from the Divi Theme Options
  • “et_divi_mods” – settings file exported from the Divi Theme Customizer

  1. Import the file in the indicated context.

And that’s it! We hope you find our solution to this pesky little problem useful, and hopefully, you’ll never again see the “This file should not be imported in this context” error in Divi. Do you have any other Divi frustrations similar to this one? Share them in the comments!

Shares

Have you seen our

Divi child themes?

Divi Toolbox plugin?

We offer a great selection of high-quality Divi products to speed up your work. Feel free to use a coupon code IREADBLOG at the checkout to get a 10% discount!

24 Comments

  1. Samuel Mungujakisai

    Simply create a folder called “cache” in the wp-content folder.
    This fixed my issue

    Reply
  2. Bryan

    Very useful. Thanks.

    Reply
  3. Zara

    It solved the problem. Thank you.

    Reply
  4. Rahul Kaushik

    Just increase upload_max_filesize and post_max_size and this issue will be fixed.

    Reply
  5. David

    check php settings

    Reply
  6. Vicki Montessoro

    I did the following. It said et_builder in the notepad. I changed it to classic DIVI and I still got the same error on a layout I purchased from Divi layouts. I AM FRUSTRATED

    Reply
    • Ania Romańska

      Hi Vicki!
      I’m sorry, but you won’t be able to change how these JSON files should be imported by editing that first line of code. If the file says “et_builder”, the only way to import it is directly via the Page settings in the Builder.

      To clarify – directly on the page means that you can only import it when you’re inside the builder, editing or adding a new page or post. You’d choose to use the Divi Builder and then open the Import/Export panel by clicking the arrows icon in the purple menu bar.

      By the way, if it’s a layout you purchased somewhere – it’s always best to ask the author for installation instructions 😉

      Reply
  7. Iris Bezuijen

    What is this is not helping? And you do load in the correct context, but the error still apears?

    Reply
    • mike crom

      This crap doesnt work …….i do know all the import tips and tricks for divi and this and most of you crappy demo work generates an error message. Good thing I decided to go with Divi Pixel instead of this garbage. Total waste of valuable time

      Reply
  8. Claudia (Jose-Fine) Schäfer

    Gosh! That easy? really?
    THANK YOU! I already forums flooded about that …

    So cool!

    Reply
    • Ania Romańska

      Claudia, you were our inspiration to find this! 😉

      Reply
  9. Michal

    So this is a TOP useful tip. Good job! Thank you.

    Reply
    • Edyta Zimny

      We’re happy we could help!

      Reply
    • Edyta Zimny

      We’re so happy you found this little tip helpful!

      Reply
  10. Sharon

    Great tip Ania – yes have experienced this , reading the json file in txt editor certainly fast tarcks the process ! 😊

    Reply
    • Edyta Zimny

      It’s just a little thing and yet it changes so much, right? 😀

      Reply
  11. Marc Scheithauer

    This is exactly the kind of “tips and tricks” I’m always looking for: to the point, solution-oriented and explained in a very comprehensible way!

    Thank you very much

    Reply
    • Edyta Zimny

      Thank you for your kind words! We keep striving to do our best :))

      Reply
  12. Jim Brett

    Great explanation – too bad Elegant Themes doesn’t mention your steps in their documentation.

    Reply
    • Victor

      Or even better, they should just mention where the JSON file is meant to be imported in the error message. This would be a super easy UX improvement to implement for Elegant Themes and probably take them less time than handling the support tickets for related questions during one single month.

      But in the meantime, this is a nice work around.

      Reply
  13. Deschamps

    Thanks for this information 🙂

    Reply
    • Edyta Zimny

      We’re glad you found it helpful!

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Enjoing our content?

You might find this interesting…

License Details

REGULAR LICENSE

Single Site

A regular license allows an item to be used in one project for either personal or commercial use by you or on behalf of a client. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

EXTENDED LICENSE

Unlimited Sites

An extended license allows an item to be used in unlimited projects for either personal or commercial use. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

SUPPORT & UPDATES

Each license is a one-time payment. There are no annual fees. You get lifetime access to product updates. Support is provided for 6 months from the date of purchase.

Server Requirements

SERVER SETTINGS:

  • PHP 7.2 or later
  • upload_max_filesize (256M)
  • max_input_time (300)
  • memory_limit (256M)
  • max_execution_time (300)
  • post_max_size (512M)

PHP.INI SETTINGS:

  • php-xml or/and php-dom
  • XMLReader
  • PHP CURL module

PHP MODULES:

  • allow_url_fopen

Would you like to...

Consult Ania and fellow students?

Join the conversation inside our private FB group.

Would you like to...

Get support privately?

Submit a support ticket via your account page.

Ask Ania?

Submit a question for the next live Q&A session.

Consult fellow students?

Join the conversation inside our private FB group.