1. 19
    Replicate a Remote WordPress Site Locally by Importing Content and Logic
    2m 23s

Replicate a Remote WordPress Site Locally by Importing Content and Logic

Share this video with your friends

Send Tweet

It is critical for development that your local environment accurately reflects your remote site. In this lesson, you will learn how to import plugins, configuration, and content from a remote to a local WordPress instance.

There are a few steps to do this:

  • Create a fresh install of a WordPress Instance
  • Copy the wp-content folder over to your local site
  • Activate all the necessary plugins that allow the instance to function properly
  • Export and import custom post types
  • Upload the generate content XML file to the local site
Patrick
~ 4 years ago

In the video you demonstrated how to overcome the issue with a non-existent post type when doing the import. There were, however, still a number of "Failed to import media" messages.

Is there a way to fix these?

Kevin Cunninghaminstructor
~ 4 years ago

Hi Patrick, Great spot! I should have addressed that in the video.

There are two possible solutions here:

  1. By using Cloudinary - there is a video later in the course that shows how to do that
  2. The error is to do with the change in the URL. I think this deserves an extra video. We need to add some code to our custom theme to override a security feature that stops external URLs to being used in this way.
add_filter('http_request_host_is_external', '__return_true');

This is an example of the code that would allow the import to work without an error. It's worth saying that this line should be removed after the import is complete to re-enable the security feature.