Press enter to see results or esc to cancel.

Failed To Import – Invalid Post Type

When importing a WordPress theme’s sample content using an xml file provided by the theme’s author, you may run into the following error message – with the import failing: Failed To Import – Invalid Post Type.

The obvious thing to check before you do anything else is that your theme and it’s custom post types are activated and enabled. Import will fail if you attempt to import custom posts of a custom post type that does not exist.

If however you have activated your new theme and the custom post types of that theme are enabled, you will be more perplexed by the error message shown. How can the custom post types be invalid when they are obviously implemented and enabled?

I attempted to import a sample xml file for a client of mine and faced the same error. The theme was activated and the post types enabled and after searching for a solution I finally found this post on the the WordPress.org forums that explained how to resolve this issue.

Basically, for a reason unbeknown to me, the server configuration was not allowing an import from an xml file using the WordPress Importer plugin. To work around this I compressed the sample xml file using gzip compression (I downloaded 7zip compression software) and then uploaded the resulting .gz sample file. The import went through without a hitch.

Comments

Leave a Comment