Encountering the This File Should not be Imported in this Context error when importing a JSON file in Divi can be frustrating, as it prevents you from using valuable design elements and layouts.
This error typically occurs due to compatibility issues or incorrect import settings. In this article, we will guide you through the process of resolving this error when importing JSON files into Divi.
Sometimes, when you start importing a layout from another website (or the same site as well), you might see an error message like the one below.
The Reasons for the Error
The reason for that error is that the JSON file is not importing into the same location from where it was exported.
Each exported layout is assigned one of these 3 contexts to it:
et_builder_layouts - For a layout exported from Divi → Divi Library or Divi Cloud.
et_builder - For a layout that is exported from an individual page/post.
et_theme_builder - For templates exported from Theme Builder.
Layouts exported from Divi → Library or Divi Cloud can only be imported into the Library page.
The ones exported from an individual post or page can only be imported in the same context (on a page/post or any other custom post type).
The Solutions to the Error
If you see this error while importing a JSON file on an individual page and you are not sure from where the JSON file was exported, you can go to Divi → Divi Library and try to import the JSON file there.
If the import works (without any error), it means that the file was first exported from the Divi Library
In this case, you can create a new Page, and import the Layout from the Divi Library
If you see the error while importing the layout in Divi Library or on Divi Cloud, follow these steps:
Create a new page
Try to import the JSON file to the new page
After the import is successful, use the Divi Portability option to save the new layout to either Divi Library to your Divi Cloud account.
If you can't import the JSON file on a page/post or into the Divi Library, it was most likely exported from Theme Builder.
Go to Divi → Theme Builder
Use the Portability option and import the file directly to the Theme Builder
Divi Cloud Note:
If you've purchased a layout(or more) and you're trying to upload it on Divi Cloud but you receive this error, that means the JSON file is an individual layout that needs to be imported on an individual page first.
Once you upload it on an individual page, you will be able to save it to the Divi Cloud directly from the Visual Builder