The Ultimate Divi Bundle - 5 Divi plugins. 1 great price.
Learn More

Fixing “This file should not be imported in this context.” Layout Error

Having trouble exporting and importing Divi builder layouts? These tips might help.

Recently, while trying to export / import a Divi Builder page, I received an error I hadn’t seen before:

This file should not be imported in this context.

A quick google led me to see that this was a problem others have been having. In reply to one such comment, Elegant Themes’ advise:

This means you are uploading the file to the wrong place, or you are uploading the wrong type of file… Go to Divi > Divi Library and click the “Import & Export” button. Also, be sure to unzip the file first and upload the .json file inside.

I was trying to export from a page and import to a blank page on another site, so there didn’t seem to be any particular problem with the place I was uploading the file to. While I could have tried uploading it to the Divi Library directly, I was pretty sure I should be able to import directly to the page, and it was something I wanted to do, so I figured I’d save the Divi Library upload as a last resort.

Looking at the file I had exported, it was of the right file type (.json), and was not zipped. However, when I opened the file, I realized it was completely empty. Clearly there was a problem with the export which needed to be sorted before the import could be expected to work. I tried reloading the page I wanted to export, and re-exporting it. However, the exported file was again empty.

I decided to try first saving the page as a layout on the original site (using Divi Builder’s “Save to Library” feature). After doing this, I tried exporting again. This time, the exported file contained the correct content and I was able to import it directly to the target site, without error. It seems Divi exports the layout a page is based on, rather than the content of the page itself, and so you must first create a layout from your page.

So if you are getting the same error message, try saving your page to the Divi Library prior to exporting it.

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.

Want get more out of Divi?

Hundreds of new features for Divi
in one easy-to-use plugin

4 Comments

  1. Nik

    I’m having this issue as well, annoyingly! Saving it to the library is not working for me, neither is changing the file name.

    Reply
    • dan

      Sorry to hear it got you too, Nik! I’m not sure what else to suggest, but if you’d be willing to let me log into your site and take a look I might be able to figure it out. If you do, send me the URL / login details through my contact form, along with details of the page you’re trying to export. Thanks!

      Reply
  2. Alejandro Flores

    Sorry for my bad english,
    If you have this same problem and you already have wordpress on a server, try giving write permissions to the wp-config folder, if you use linux navigate to the folder you want to give permission and use this command

    Chmod -R777.

    I’ve been searching for the solution for a few days and this worked, I hope it helps

    Reply
    • dan

      Thanks for sharing, Alejandro. I take it you meant the “wp-content” folder, right?

      One thing, I’d be wary of setting the permissions on the folder to 777. WordPress recommends avoiding 755 as the default permission for folders, and avoiding 777. If you do need to set it to 777 to get this to work, I’d change it back to 755 as soon as possible.

      Reply

Submit a Comment

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