WordPress – How to Export All content from WordPress site?

WordPress provides a feature to allow us to Export the content of WordPress site into an XML file. This is an important feature when you move your WordPress site to the different hosting provider or when you want to take the backup of your site content.

We will go through the below steps; explains how to export the WordPress site content.

Step 1. Login into your WordPress site as a site Administrator. This important, because ONLY for the administrators all the options or features are enabled.

Step 2. Once you log-in, WordPress displays a Dashboard’s Home page, from where you can quickly access other areas in your WordPress site. Like the Dashboard tab, you will see other tabs also once you login into your WordPress site.

Select the Tools tab and then select the Export option. WordPress will display Tools’s Export page; which allows you to export WordPress site content into an XML file.

WordPress - Tools - Export All Content
WordPress – Tools – Export All Content

Choose what to export

Tool’s Export page provides options to export all the content of the website or only partial site content. This page displays below options:

All content
Posts
Pages
Media

We will look into “All content” option through the below steps.

Export All content

Step 3. To export all the content of the site, select “All content” option. This will export all of your site’s posts, tags, comments, categories, links, link categories, pages, tags, custom fields etc,

The size of the XML file will be more when you export through this option; because it contains all the content of the site. This consumes more memory than other export options available.

Step 4. Once the “All content” option is selected click on “Download Export File” button to download the complete content to the XML file. WordPress will start Exporting all the content to an XML file.

As I mentioned above, memory consumes more when you Export all content. Sometimes this may cause an issue. Usually, you will see below Fatal Error when you attempt to export using this option:

Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted (tried to allocate xx bytes) in <<php-file-name>> on linexxxx

How to fix the Fatal Error: Allowed memory size issue?

You can fix this, by increasing the memory limit for the PHP program to run. This limit can be mentioned in the WordPress’s configuration file or through “php.ini” file. Below are the steps to do this in WordPress’s configuration file:

Step 5. Login into your WordPress hosting panel as an Administrator and go to the root folder where you have installed your WordPress site.

Step 6. Look for the file wp-config.php where the WordPress site’s configurations are defined. Open the file to edit.

Step 7. Look for the definition entry WP_MEMORY_LIMIT in the file wp-confirg.php . Change it to the reasonable size, which is suitable to fix the issue. Usually below value should suffice.

define( 'WP_MEMORY_LIMIT', '96M' );

Note that, the changes may NOT work; if your hosting provider NOT allowed to increase the PHP memory limit. In such a case, you can follow the steps to export partial content at a time (this way memory is not consumed much, compare to exporting all content at a time) or contact your hosting provider to allow to increase the PHP memory limit.

Step 8. Once the changes are done, save the changes done in the wp-config.php file.

Step 9. Try again to Export all the content of your site (Step 4). If you still see the same Fatal Error; there might be some other reason for this issue. You can try exporting partial content instead of All content at a time. I will explain this in my next Article.

This is the way we can export all content of the WordPress site.

We discuss more in upcoming Articles.

<Mourya>

2 Comments

Add a Comment

Your email address will not be published.