I am modifying a website on wordpress (codex) and I would like to import all the .doc files (about 200) from the old website and make them into posts on the wordpress website.
Any ideas how to do this bulk import or is the only way to copy and paste each one, which will take a long time.
I am modifying a website on wordpress (codex) and I would like to import
Share
There Is a way to do this – but as far as I know – it is not easy ..
I struggled with it one time – but could achieve it in the end .
The reason is that a WORD *.doc is a complicated format , and even simple Copy&Paste can make problems (as it actually copies also formatting)
You need to use the COM interface in php , turn the DOC to a TXT file or a string , and then create the post with
wp_insert_post( $my_post );so – opening the DOC . (you need to loop for bulk )
Then, either read a txt file , or if in the same function use the $my_doc_string directly.. :
NOTE : the COM interface , as far as I know , Is available only on the WINDOWS vesion of PHP , and you will also need to have MS WORD installed …
some more reading for you :
http://php.net/manual/en/book.com.php
http://docstore.mik.ua/orelly/webprog/php/ch15_03.htm
http://www.gsdesign.ro/blog/extracting-text-from-word-documents-in-php-with-com-objects/
EDIT I –
After reading your question again – if you have an OLD website – why do you need the DOC files ? you might be able to do that with an HTML PARSER (if the OLD website has the same content as the DOCs – but in HTML)
EDIT II – unbelievably – today I have stumbled into this plugin, it might be of some help although I did not tried it .
http://wordpress.org/extend/plugins/auto-poster/screenshots/