2

I'm currently developing an updated version of a live site in a local environment. It's a very large site and the local dev site is using a entirely new theme without many of the live site's plugins or functionality. The live site uses Avada Fusion and almost all content is wrapped in shortcodes forcing me to basically re-publish each post manually using the dev site's new setup (using ACF Pro, custom fields). I've spent weeks removing the live site theme, unnecessary thumbnails, plugins, and all sorts of space hogging files. The only problem is bringing in the new posts from the live site. They are adding new posts weekly and I'm about 25 behind. :)

Is there a way to export/import the new posts from the live site into the local dev site that would include all the posts' featured images, galleries within the post, etc? This would only be for posts, and I would love to pull from a specific date like May 15 to Current.

I attempted the standard Tools > export/import and it added the posts ok but it didn't include featured images or any of the images within the posts. I'm curious about plugins like WP Migrate DB Pro and their merge feature but I don't want to overwrite or add back any of the images I've painstakingly removed or regenerated with lossless compression.

1

2 Answers 2

0

Have you considered to use REST API to bridge the two environments?

Basically you need to hit the posts endpoint https://example.com/wp-json/wp/v2/posts using the after argument that permit to limit response to posts published after a given ISO8601 compliant date.

With the response you can insert new posts and sync the two installation.

More detail about the endpoint and the arguments can be found here https://developer.wordpress.org/rest-api/reference/posts/

0

Thank you for the responses. I was able to get it handled by using a plugin.

https://wordpress.org/plugins/export-media-with-selected-content/

I'm going to look into the REST API solution for keeping it up to date while I continue the development side of the project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.