Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a non-CMS website which is fully build with PHP with a lot of content in it. I don't want to add my posts manually in Wordpress, because that's a pain in the ass (I am talking about 5000 posts)...

So my question would be: how do I do this? Is it even possible to clone something like this?

share|improve this question
    
This is a very broad question. How is your data stored? What have you tried so far? Have you examined how the import mechanism in WordPress works? What specific questions do you have? –  Andrew Bartel May 30 '13 at 16:36
    
This is a question that is answered very well by Jouni Leader. I hate the fact that some people are thriving on criticizing people's questions, even if they are good enough to give an answer. Especially using the downvote button is pathetic. –  user1627363 May 30 '13 at 17:22
    
I'm sorry you feel that way, but if you had posted a specific question you would have received a much more targeted answer. Even something like, my data is stored in a mysql database and the content is in a single table, how do I convert that to a format that WordPress could understand? would have been a lot more helpful. –  Andrew Bartel May 30 '13 at 18:06
1  
I must disagree with Andrew a bit. It doesn't really matter in which format the data is stored as long it's stored in a database. The question was broad yes, but it wasn't impossible to answer to. Down vote was a little harsh thing to do. Comment with request for more specific question would have been much more constructive. –  jleander May 31 '13 at 8:35
    
Thanks Jouni, couldn't say that better! Once again, thank you very much, it has worked! –  user1627363 Jun 1 '13 at 12:12
add comment

1 Answer 1

up vote 4 down vote accepted

If your data is inside database as I understand, it is possible to export your database to CSV file and import this to Wordpress. CSV file is basically a comma separated list of data from your database that makes it possible to transfer data from different database structure to another.

It does indeed take some effort to configure your export/import so that you get your data right, but it's a lot easier thing to achieve than re-posting 5000 posts.

Look for Wordpress plugins "csv importer" and/or "wp ultimate csv importer".

You can export your data using your SQL-client (these often have an option to export in csv) or using PHP (see http://www.coderelic.com/2012/01/export-data-from-a-database-to-csv-excel-with-php/)

If your data is NOT in database, you could consider web scraping techniques (see: wikipedia / Web_scraping) where you go through your site programatically and look for id's, classes and elements to create structured data out of your html files.

Hope this was helpful!

share|improve this answer
    
Thank you very much, Jouni! I tried using XML before, but did not try CSV. I think I can pull it off with this. It is indeed very dumb to re-post 5000 posts... Thanks again! –  user1627363 May 30 '13 at 17:23
    
You are welcome. I hope you get your transfer done. –  jleander May 31 '13 at 8:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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