Link to home
Start Free TrialLog in
Avatar of Leonard Zakoor
Leonard Zakoor

asked on

Populate custom post type/custom fields from an external database in WordPress

I have a custom MySQL DB(same host/different domain) with a lot of vehicle information.

What we want to do is populate a custom post type and custom fields with this data so that it's SEO friendly in WP. Is there any way to do this in WordPress? Basically have WP look at this table to populate the custom post type. We will NOT be using WP to manage this data. When the data is updated in this table, it should automatically be updated in WP.

So basically not an import, just read off of the other table. If it helps, we do have a REST API built too.

I'm hoping what I'm saying makes sense. If it doesn't, please feel free to ask me questions. This is a pretty big deal to us and we really want to figure out the best solution.
Avatar of arnold
arnold
Flag of United States of America image

You would need to script the data transfer/export from your db to the WP MySQL.
Given the vague description of data rendering, you would need to have your script function as WP would.
The WP page where a sample data is reflected, I would locate the basis/references and then make sure the script on your MySQL side adds appropriate entries in the WP db

......

I realize it is easier said than done.
The complexity/simplicity will depend on how you want your WP page to render/display that information and what options you want available to seo to deal with that info?


I.e. Is it a simple display of statistical data, reflecting the current list of vehicles in the enterprise, or does it go beyond that?
Avatar of Leonard Zakoor
Leonard Zakoor

ASKER

Hey Arnold. Thanks for the reply.

I was talking over a few things with some PM's and stake holders to make sure I understand everything correctly. The data itself is pretty straight forward. There's only 2 tables I'll need to touch with WP. I thought there was only 1. The good news is we have 1 ID that connects everything. So I can query the main DB on this ID and return everything relating to it. The data itself is pretty flat honestly.

I'd like to have WP just have these custom post types as normal. The ultimate goal is honestly just to have SEO friendly pages. We literally just want to have a setup where we can install a WP instance, activate a plugin and enter in the ID into the plugin. I maybe over simplifying this but honestly that's the ultimate goal/idea.

The script you're referring to should be written in language? SQL? Like a trigger?

I've looked online absolutely everywhere and I cannot find any kind of scenario similar to this. Am I going about it the right/wrong way? I feel like this should be something relatively easy.
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial