Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7715911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:30:22+00:00 2026-06-01T02:30:22+00:00

I am modifying a website on wordpress (codex) and I would like to import

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:30:23+00:00Added an answer on June 1, 2026 at 2:30 am

    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 )

    $filename="file.doc";
    $TXTfilename = $filename . ".txt";
    $word = new COM("word.application") or die("Unable to instantiate Word object");
    $word->Documents->Open($filename);
    $word->Documents[1]->SaveAs($TXTfilename ,2);//  '2' for txt format
    $word->Documents[1]->Close(false);
    $word->Quit();
    $word->Release();
    $word = NULL;
    unset($word);
    $my_doc_string = file_get_contents($TXTfilename); //write file
    unlink($TXTfilename);
    

    Then, either read a txt file , or if in the same function use the $my_doc_string directly.. :

    $title_p = 'mypost no'.$i;
          $my_post = array(
          'post_title' => $title_p,
          'post_content' => $my_doc_string,
          'post_status' => 'publish',
          'post_author' => 1 
          );
          $post_id = wp_insert_post( $my_post );
         wp_insert_post( $my_post ); 
    

    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/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a website that we would like to extrapolate user controls from and
I got this from a tutorial website, and was modifying it for my website.
Currently, I am modifying a css document to make a website compatible in IE
I'm modifying a website made with osCommerce (I didn't make this website), and one
100%I'm modifying an older website for a client that uses Ext-JS 1.1 and I'm
I am modifying the MoveMe example from the apple web site. When my controller
I have a message display field on my website that I'd like to change
I am programming my first real PHP website and am wondering how to make
My organization is rewriting our database-driven website from scratch including a brand new database
I'm working on a database driven website (I didn't code it, just modifying few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.