skip to Main Content

I used to have a WordPress website a few years ago. After getting hacked, I decided to create my own PHP script and extract the necessary data from my WordPress Installation and keep the same URL structure. Now, a few years later, I want to move back to WordPress for various reasons. My site has over 2500 articles, and manually importing these articles will be a pain, and I want to keep the same URL structure, as to not lose any SEO.

Here is my SEO structure

https://www.example.com/post-id/post-title-all-lower-case/

I have a database with the following values:

post id
post url (the url slug)
category id
post title
post content
etc..

I can easily create an xml or rss feed with these values for the 2500 posts. But I don’t know how to import this content to wordpress. Anyone got any ideas on how I can go through a smooth transition?

I just need this content imported. Creating the theme and everything else is the easy part.

All help is greatly appreciated!

EDIT: SOME PROGRESS!

I have uploaded all my content to a new wordpress installation. Each post has a custom field with a unique number. This number MUST be the post_id.

How do I make it so that I make this custom field the post_id of that post?

All help is greatly appreciated!

2

Answers


  1. I did something like this a couple of years ago, using MS Excel to concatenate the cells to export to a csv file we could load directly to the mysql db using PHPMyAdmin. We were also doing categories, which involved various tables. For posts, I think you can load directly to the wp_posts db table. I’d create a single post in WP, look to see what table counts change. The look at the tables that changed to see how you would need to populate a csv file to load your content.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search