Elegant Themes Blog

Stay up to date with our most recent news and updates

How To Import Posts & Pages From One WordPress Website To Another

Posted on January 22 by in Tips & Tricks | 85 comments

How To Import Posts & Pages From One WordPress Website To Another

Migrating content to another website is a dilemma that many WordPress users face at one time in their life. The act of copying specific posts and pages over to a new website involves copying table rows from one database to another. Doing this directly using a database management tool such as PHPMyAdmin requires knowledge of MySQL and a good understanding of how databases operate.

Thankfully, a more practical solution exists. The Official WordPress Importer allows you to easily export content into another website using an XML file. It allows you to move:

  • Posts, pages and other custom post types
  • Comments
  • Custom fields and post meta
  • Categories, tags and terms from custom taxonomies
  • Authors

I used the WordPress importer a few years ago. At the time, I had an official company blog which I was publishing company news and personal posts. Later, I made the decision to migrate the personal articles to a separate blog on a different domain. The importer allowed me to do this easily.

In this article, I will walk you through the process of exporting and importing content between two WordPress websites. The procedure is simple and does not require any technical knowledge.

You need access to both websites in order to migrate the content successfully. Additionally, I strongly encourage you to take a back up of the database of both websites so that you can restore them if something goes wrong.

Exporting Content To Another Website

The core version of WordPress (i.e. with no plugins installed) has export functionality built-in. You will find the export feature in the main WordPress admin menu in the Tools section.

There are three options available. The first option backs up all content including posts, pages, comments, custom fields, categories and tags.

The WordPress Export Page

The WordPress Export Page

Alternatively, you can choose to only export posts or pages. You can filter what is exported and only export content from particular categories, authors, date range and publication status.

You can filter what posts and pages you want to export.

You can filter what posts and pages you want to export.

The export function will also list any other post types that your website uses. For example, I use the Ninja Popups plugin on my personal blog to display pop up messages. As this is a custom post type, WordPress gives me the option of exporting the content for that post type to another website.

Once you have decided what content to export, save the XML export file to your computer.

Save the file to your computer.

Save the file to your computer.

Importing Content From Another Website

The WordPress import options can also be found in the main admin menu under tools. Import functionality is not built into the WordPress core, however there is a good reason for this.

In total, WordPress provides eight official import systems (many unofficial importing plugins are also available). Therefore, WordPress offers these import systems as plugins so that the core version of WordPress is not bloated.

A range of import plugins are available for WordPress.

A range of import plugins are available for WordPress.

As we are importing from another WordPress website, we need to install the WordPress installer. You can do this manually by downloading the plugin from the official plugin directory. A more practical solution is to click on the WordPress link on the import page. This will bring up a pop up box that allows you to install the plugin directly through your website.

You can install the WordPress importer directly through your WordPress website.

You can install the WordPress importer directly through your WordPress website.

Once the plugin has been installed and activated, you will be taken to the import page. This is where you upload the XML file you exported earlier.

Upload Your Import File

Upload Your Import File

You will then be given the option to assign imported authors to existing authors on your website. This is useful if the same authors exist in both websites. Alternatively, you can create a new account for each author’s posts.

This page also has an option for downloading attachments. When you select this, WordPress will attempt to import all of the images that are attached to the posts and pages you are importing.

Assign imported authors to existing authors.

Assign imported authors to existing authors.

That’s all there is to it. Your content will now be imported into your website. You can verify this by checking your posts and pages.

All information will be identical to what it was before. Therefore, posts and pages will have the same publication date and be assigned to the same categories.

Congratulations - You have imported all content into your new website.

Congratulations – You have imported all content into your new website.

Final Thoughts

Whilst the WordPress importer can be used to migrate all content from one website to another, it is not an ideal solution for transferring a full website to another location as website settings are not transferred.

You should also be aware that the WordPress file upload limit is applied to the WordPress importer. This default upload value is defined by your hosting company. Sometimes this limit is 8MB, sometimes it is as low as 2MB. This can cause difficulties when you are importing a large number of posts and pages.

To address the issue, you need to increase the maximum file upload limit. This can be done in a number of ways including modifying your theme functions.php file, modifying your .htaccess file, and editing the php.ini file. Do not worry if all of this seems too technical.

The best solution is to ask your hosting company to increase the file upload limit for you. If they refuse to do this, you should probably review your hosting situation :)

Should any part of the import process go wrong (such as importing the wrong content), simply restore the importing website using the backup you made earlier. This allows you to start the import process from scratch and ensures that everything goes the way you want it to.

If you found this tutorial useful, I encourage you to subscribe to Elegant Themes and get our latest posts delivered to you via RSS or your favorite social media service.

85 Comments

  1. Great post, as always, thank you for the tips and tricks, is it possible to to know, which pluggin will work to migrate from joomla to a wordpress, i am searching for some forums about it , but i would like to know from the expert. Thank you

  2. Kevin Muldoon

    I have never imported from Joomla myself, however the WordPress codex has some links to importers – http://codex.wordpress.org/Importing_Content#Joomla

    Unfortunately, the links noted on that page seem a little outdated.

    I had a quick check in the plugin directory and found this plugin: http://wordpress.org/plugins/fg-joomla-to-wordpress/

    It is up to date with the latest versions of WordPress and Joomla. In fact, it was updated two days ago. Looks like a good way to transfer content over.

  3. I just had to walk through this when moving to WP-Engine. The JetPack Carousel Galleries did not move properly when using the export/import so I had to manually rebuild these. I did this by going into each upload folder, and grabbing all of the non-thumbail photo’s and importing them each as a new gallery. It was a pain, but they survived.

    • Kevin Muldoon

      Hi David,

      I would not recommend the WordPress importer when transferring to a new web host. It is much better to simply copy the database over and and migrate the files.

      Glad you got it sorted though :):)

      Kevin

  4. I use the BackupBuddy for this. Its ImportBuddy tool makes the migration very easy. (Not *quite* one click, but fast and straight-forward.)

    It’s not cheap, though, so it may not be worth getting unless you’re also looking for a backup solution.

    • Kevin Muldoon

      BackUpBuddy is a great backup tool. I personally use VaultPress on all of my WordPress websites :)

  5. What about pages and/or posts created with Elegant Page Builder ? It is exported as well ?

    • A full database export/import should be used when transferring a website built using the builder, instead of the WordPress Importer plugin.

      • This is not completely clear to me.
        Are databases infos not copied with WP import Plugin?
        We were advised to use WP Importer when ex-importing Divi-Sites/layouts that are using PageBuilder. Does this fit the comment?
        How to export/import full database as Nick suggests?

        Some more hints would be much appreciated!

      • Hi Nick:
        I am very new to using ET and Page Builder on top of being fairly new to WP. I am also curious about what Michel-de asked. Is this more of questions for support (I browsed through the builder forum and did not find the answers there).

        Thanks!

  6. Very useful post, Kevin.

    I´m so glad to see you posting on Elegant Themes Blog too!

    • Kevin Muldoon

      Thanks Luis. I have some more articles coming up soon. Stay tuned :)

  7. Always usefull these tips ;)

    I use the free plugin ‘duplicator’ for backup up the site or moving it to somewhere else. Its works very good..

    Give it a try…

    Regards,
    Ray

    • Kevin Muldoon

      Never heard of that. There’s so many backup plugins out there. I’ve just been spoiled by how easy VaultPress makes everything with automation.

  8. With running the risk of sounding dumb by asking a seemingly obvious question, I will push ahead and ask anyways.

    Would the next course of action, after importing your content over to the new site, be to delete the content moved from the old site so google and other search engines don’t pick it up as duplicate content?

    • Kevin Muldoon

      From an SEO point of view, you do not want articles to be located at two locations (even within the same website). So it would be best to delete the content from Website A after importing it to Website B. :)

  9. great post, do you know how to import a theme from one wp site to another without ftp access? i have geographical sites and need to build an new one but want the same bespoke theme im using on my other sites but with individual logins for the wp-admin

    • Kevin Muldoon

      It’s much easier with FTP. Simply copy the theme folder from wp-content/ and upload it to the same location on your other website. Most frameworks allow you to export settings too. Failing that, you would need to ensure that the same settings were used on your second website.

      Without FTP access is more difficult. You would need to backup the theme some other way and then import it as a zip file.

      FTP is definitely the best way to do this.

      • thanks kevin, is there no way of downloading the theme file from within the wp admin no?

        • Kevin Muldoon

          I do not believe so. You could download the files through the hosting file. There is perhaps a free backup plugin that lets you zip it up.

  10. We’re rather graphic heavy … featured images, thumbnails, extra images in every post. Will the WP Exporter/Importer grab them, too?

    • Kevin Muldoon

      Yes. It should do.

      Be sure to make a backup of all your files (including images) and your databases, before you attempt to use the importer. You want to be able to revert to how things were if something goes wrong.

  11. Very useful…I tend to build websites on a subdomain of my server and then when clients are ready to go live, I pay someone to transfer the site over from http://www.testsite.mydomain.com to
    http://www.livesite.com

    I read in a few of the responses here that there is an easy way to do this? If someone is so kind, can you please give me an easy solution to doing this? I am always concerned about images, attachments, posts etc. and them following to the new site.

    And then to add to Jason’s comment above…after the transfer, I’ll be able to delete the demo/test site so that it does not appear in 2 different areas.

    Thank you..

    • Kevin Muldoon

      I would just migrate all files and them migrate the database. Then you simply change the URL settings etc.

      The importer is not the ideal solution for transferring websites. It’s more about exporting specific content from one website to another.

      • Thanks, I was wondering about how to solve this. Well, since I’m using ET-Page Builder(divi), I think exporting post and pages should be easy?

        • Kevin Muldoon

          I have not used Divi myself yet. Though I imagine the settings have to be exported separately.

      • Thanks Kevin for the article.

        I have the same need as David.

        What do you mean exactly by ‘migrate the files and then migrate the database’
        Is this another method?
        Where can we find documentation on that?

        Thanks for any hint!

  12. What about just importing 2 pages along with their images (caption, description, alternative text, etc..) to the new wordpress site. I wouldn’t want to transfer the whole site which is just bloated with other plugins and themes and many pages.

    Would the videos and pictures (along with their details) need to be manually imported?

    • Kevin Muldoon

      You can filter posts during the import process using categories and dates. You could do this and then delete any irrelevant posts.

      Images should be imported though I am not sure how it handles uploaded videos. In theory, they should import again, but I am not sure of that.

      • I just performed an import and instructed it to import the files attached to posts. All it did was import the links, so the images all show but are in the original location.
        The only way I can do this is to:
        1) Edit database to replace incorrect image address with the correct address.
        2) Upload all images using the media library.
        3) Assign each image to the correct post or page.

        This is a lot of extra work and will take hours on the site I am working on. Not ideal. Wish there was a quick solution.

        • Kevin Muldoon

          It should have imported the images too. Did you remember to include the download and import images option?

          • yes, i followed the steps as described.

          • Kevin Muldoon

            I am unsure as to what went wrong.

            For the purpose of this tutorial, I imported posts from my personal blog to my test website. The correct articles were imported correctly with all images.

            If this happened to me, I would probably restore the importing database and try the import process again.

            If there are not too many images to be imported, I’d probably transfer them over manually.

  13. Great article. I have more confidence in BackUp Buddy for these actions. VaultPress looks good too, maybe another article about that should be cool.

    I´m using a Digital Ocean VPS (very fast and cheap) with a fairly good setup: NginX , APC and Varnish. All works wonderfully, but I couldn’t increase the upload limit to more than 2 MB, so most of the file transfers are done using sFTP.

    • Kevin Muldoon

      I’ll speak to Nick about a review of VaultPress :)

      Did you speak to your host about increasing the upload limit from 2mb?

      • I’d love this! and all about “jetpack” itself.

  14. Hi Kevin,

    Thanks for the post and this is exactly what I was looking for. My only questions is when I import the xml file will it merge with a preexisting site (i.e. already has post and page content) or will it erase the current content and and replace with the imported xml? Any help is appreciated.

    • Highly recommended plugin

  15. Beware of WordPress, but this is an complete guild line for import or export posts & pages for new WordPress website

  16. Yes, this is the correct way to migrate or clone WordPress content.

  17. I’ve just done this to bring in the content from a WordPress.com blog into a self hosted WP site I’m building and it worked fine, including importing the images.

    For shifting whole sites I have used WPClone to move it then Velvet Blues Update URLs to correct links. Works well for me.

  18. What about moving a whole website to another URL within WordPress – for example: http://www.ABC.com has an ET theme installed and the site is completed. Customer wants to move it to another active URL lets call that http://www.123.com which is also already activated on a WordPress account but hasn’t yet had any theme installed or content added. How would one go about doing that?

    • Kevin Muldoon

      It is better to copy the database and files from website/location A and transfer them over to website/location B. Then you just need to change the website URL’s etc.

  19. Great tutorial, that all i need when wanna import the post from others one.

  20. I have been a member of Elegant Themes for a year or so and I really love them. All their theme releases have been fantastic and they have made it much easier for me to make my websites look amazing. And since I am such a fan of this website I thought it was about time I wrote an Elegant Themes

  21. This tutorial is very simple and easy to understand, if available are free elegantthemes I really want to use it.

  22. Hi Kevin!

    Thanks for this explanations! Really good to understand for a non-expert also :-)

    We’re doing some tests, because our website we must setup completely new (online with WP 3.4.2 – due to some technical problems with our server (Strato) we can’t update to higher versions).

    I made a localhost with WP 3.8.1, imported all articles properly. Worked perfect.
    Then we wanted to see, if I make on localhost a little change, and import it back to the online website, if the article is back without losing the social shares.

    But nothing has changed… I wrote at the end “test xxx” but this is not appearing. Where is the changed/imported article gone??

    Practically at the end our main points what we want to be sure is:
    1) Does Google finds back all the links when we make the site with new theme complete new.
    2) How can we avoid to lose all the social shares. I use WP Sozialiser… put the same question in the Forum, bu tnot reply since two days :-(

    Please note that we’re no experts for WordPress. All made with learning by doing.

    Would be great if you can clear my mind :-)

    BR, Petra

  23. Kevin Muldoon

    It is difficult for me to say where the article has gone without seeing the databases.

    One thing I would note is that article shares are attached to the page URL. I the url of the article does not change, the number of visible shares will remain the same.

    1. A theme does not change the url structure of your website so has no affect on links etc.

    2. Again, you will not lose any shares if you are only changing theme. If you are changing domain, you would have to 301 redirect from one domain to the other.

    :)

    Kevin

  24. I was a member of elegant themes, almost all available plugins are very useful for me.

  25. One small caution: I used the WP Export/Import tools to move just blog posts from an old domain to a new one. It works really well except for one thing. It didn’t copy over the image files to the new location. The links to the images in the old location are in the posts so everything appears correctly, but if I take down the old site all the images will disappear. I’ve used UpDraft and Duplicator and they are great for migrating an entire site, but moving just a portion of site still remains problematic. I now have to go through each post or the DB and replace the old domain with the new domain AND make sure all the images are in the same paths on the new site. If anyone has had a different experience or knows of a tool that will allow the full relocation of JUST the blog section (including the repathing of images), I’d be grateful for the tip!

    • Kevin Muldoon

      Images should transfer correctly. If they do not, simply do a find and replace query in your database for the old location for the new one. That will instantly fix all the images.

  26. Wow it really nice, i hope i can learn more about it. But when i tried import blogger to wordpress, sometimes it failled.

  27. Thank you for sharing this tut!
    You know if you have an extended website it’s rather complicated to make a switch with importers. So when I had migrated my website from Joomla to WordPress, I gave a try to third party tool, called cms2cms. The process was fully automated, i just made a few clicks, so in general the process took me 30 minutes. and also, they set up 301 redirects automatedly as well – I just typed a line of code at my WP root directory. Honestly, I was very apprehensive of using this tool, but at the end it was my best solution.

  28. Hi,
    Thanks for the info, can you plz explain me the procedure to change the media file and link path on the new website.

    Example: I am having a website http://example.com

    and now i want to change it in

    http://example.net

    Yes, the export function will export all of your post and pages but I am facing issue with the Media and Links.

    Thanks in advance.

    • Kevin Muldoon

      You just need to do a find and replace through your database. That is, replace the old website URL with the new one.

      If you are not comfortable using PHPMyAdmin, I recommend speaking to your hosting company or hiring a developer to help you (as you don’t want to be executing queries on your database if you are not sure what you are doing) :)

  29. Hello, when I follow this guide, I get to the last step to import and am encountering the following error:

    Fatal error: Uncaught exception ‘Exception’ with message ‘Serialization of ‘SimpleXMLElement’ is not allowed’ in /(*FILEPATH*)/functions.php:336 Stack trace: #0 /(*FILEPATH*)/functions.php(336): serialize(Object(SimpleXMLElement)) #1 /(*FILEPATH*)/meta.php(60): maybe_serialize(Object(SimpleXMLElement)) #2 /(*FILEPATH*)/post.php(1731): add_metadata(‘post’, 4264, ‘posterous_446f7…’, Object(SimpleXMLElement), false) #3 /(*FILEPATH*)/wp-content/plugins/wordpress-importer/wordpress-importer.php(741): add_post_meta(4264, ‘posterous_446f7…’, Object(SimpleXMLElement)) #4 /(*FILEPATH*)//wp-content/plugins/wordpress-importer/wordpress-importer.php(116): WP_Import->process_posts() #5 /(*FILEPATH*)//wp-content/plugins/wordpress-importer/wordpress-importer.php(92): WP_Import->import(‘/home1/…’) #6 [internal function]: WP_Imp in /(*FILEPATH*)/functions.php on line 336

    This is causing most of the import to fail. Can you shed any light on this?

    • Kevin Muldoon

      I’ve never came across that myself. I recommend speaking to your host or posting on WordPress.org forums.

  30. I wast just thinking of doing the same thing, but my concern was how to make all my internal links forward to the new site. or does this process you explained above capable of converting old links to that of the new site?

    Thanks

  31. A most excellent post, though my version of WordPress differed slightly in some respects from the instruction, I nevertheless to my utter amazement managed to transfer a post from one site to another without tearing any hair out!! Thankyou Kevin. More strength to your arm, mate. Tony

  32. Hi,

    I’ve tried to use the WordPress Importer plugin to move posts from http://www.lockwood.com.au to http://www.clarencestreetmortgages.com.au however when I try to activate the plugin, the following error message shows:

    ” Fatal error: Cannot redeclare class WXR_Parser in /home3/lockwoo5/public_html/c/wp-content/plugins/wordpress-importer/parsers.php on line 12 ”

    Any idea why this might be happening?

    Cheers,

    Katie

    • Kevin Muldoon

      I’m not sure. Perhaps the plugin did not install correctly or there was an issue with your host during the transfer.

      I recommend reverting to your backup, reinstalling the importer plugin and trying again.

  33. That is a really good tip particularly to those fresh to the
    blogosphere. Short but very precise info… Thank you for sharing this one.
    A must read article!

Leave a Reply

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

Current day month ye@r *

For the all-inclusive price of $69, you are only paying $.79 per theme!

Join our 233,869 happy customers and get complete access to our 87 themes

100% Satisfaction Guaranteed Or Your Money Back!

Sign Up Today

Signup For Access To Free WordPress Tips & Resources

Signup for our newsletter and get access to free downloads, as well as daily WordPress tips, tricks and resources.