This file should not be imported in this context

Due to Import Layout, I received an error I hadn’t seen before:

This file should not be imported in this context.

01. Try different upload methods.

Reason: Each exported layout is assigned one of these 3 contexts to it:

  1. et_builder – For a layout that is exported from an individual Page/Post.
  2. et_builder_layouts – For a layout exported from Divi > Divi Library or Divi Cloud.
  3. et_theme_builder – For templates exported from Theme Builder.

If you open a json layout file in a text editor you should see that it starts with something like : {“context”:”et_builder“, …

So, if you get the “can’t import in this context” error, try importing into both the Library, Theme Builder and in a new draft Page and see if one of those works for you.

02. Changing the Filename.

Another thing that I have found to affect whether or not the export works is the choice of filename for the exported layout. In one case, I noticed that if the filename I entered contained spaces or hyphens, the downloaded file would be empty. Simply changing the filename to a single word (e.g. “layout”) resulted in the download working correctly.

03. Changing file permissions.

A file permission error might also trigger the context error:

Make sure WordPress has the correct permissions to upload files. Instead of providing a permissions error, it will give you a context error.

Set correct permissions to the upload folder and make sure the group is www-data (or Whatever WP is run under).

04. Increase Upload Max Filesize.

Increasing the Upload Max Filesize setting fixed the context error:

To know what’s your upload max size limit simply go to your Dashboard on your wordpress site and select Media, then select Add New, look where it says “Maximum upload file size”, you will see your file limit there.

Default Max upload limit is 2MB, and if your .json template size is 5MB. Obviously is more than what is allowed to upload.

To fix this is super simple, just contact tech support and ask them to raise your max upload limit.