How to pull posts from two separate WordPress sites?
-
This one is a bit of a doozy. I’ve got two separate sites (separate WordPress installs, separate databases, hosted on the same VPS) that are set up with a custom post type “product” that has a number of custom fields defining said product. Recently, my client asked me to build a tool that could pull products from either of the sites and display them in a single presentation. On top of this, there needs to be a relatively intuitive way to edit the products included.
I originally built the tool to manage each site individually using Advanced Custom Fields and the UI is really simple using the WordPress dashboard and including “products” through a repeater post object field in a new “presentation” custom post type.
Now that the client wants to pull content from two sites though, I’m at a total loss for how to pull content from another site’s database in general, and especially through the WordPress dashboard.
Has anyone had to deal with a similar situation? It would have, obviously, made sense to build the two sites as one from the beginning had this been a consideration. But does anyone have any idea how one WordPress admin area could pull specific custom post type data from two different databases?
I found this really old post regarding accessing a separate database but it seems to only accomplish a very small part of what I need:
https://www.ads-software.com/support/topic/pulling-data-from-a-separate-mysql-database-within-wp
Anyhow, any help would be greatly appreciated and I’m happy to provide more info if needed. Thanks!
- The topic ‘How to pull posts from two separate WordPress sites?’ is closed to new replies.