Support » Fixing WordPress » how to upload multiple posts & assign them to categories?

Viewing 8 replies - 1 through 8 (of 8 total)
  • post_category needs to be an array, so something like this should work:

    $my_post['post_category'] = array(prep($row['category']));

    filosofo – you are a genius!!

    Thankyou, thankyou, thankyou for your input, it now works beautifully!!!

    I can’t thankyou enough, but I’ll just say thank you once again just to make sure I’m at least trying!!



    although there is one other small thing 🙂

    I decided to try & make it work from inside the admin panel as a plugin rather than from a url, and I’m a bit stuck on this.

    I’ve managed to get it as far as being recognised as a plugin that I can activate, and I’ve got an options page where I have a small form box where I can select my csv file.

    Only thing is when I press the “upload” button I get a white screen & it only uploads the first item on the csv.

    I’m guessing it’s just my poor php again, this is what I have at the form bit, I’m guessing its the 3 lines with the bold “echos” if anyone can help with this bit please – then I’ll be a really happy bunny 🙂 :

    function testcsv_plugin_page() {
    echo ‘<div class=”wrap”>’;
    echo ‘<h2>csvtest</h2>’;
    echo ‘<form enctype=”multipart/form-data” action=”” method=”POST”>’;
    echo ‘<input name=”uploaded” type=”file” class=”formbox1″ />’;
    echo ‘<input type=”submit” value=”Upload” class=”button” />’;
    echo ‘</form>’;
    echo ‘</div>’;
    add_action( ‘admin_menu’, ‘testcsv_plugin_menu’ );

    PS – it works perfectly when csv is uploaded from the URL submission box, just not from within the admin panel.

    Also, the URL method has the php file stored in wp-admin, whilst the plugin attempt is in wp-content/plugins

    If any of that makes a difference?

    Hi this thread has been inactive for 2 months, but I’d like to add that I have just added a CSV feature to my plugin called Mass Page Maker.

    With it, you can insert pages using a CSV and assign each individual post to which category you desire.

    dave did you ever get a working update of this script? i made the changes and it still doesnt work

    The easy way to accomplish this is to use the RSS import feature with your import file having the following for each post (item):


    The “category” entry needs to be spelled exactly as the existing category in WP.

    You don’t even have to include the standard feed file headers & footers.

    I recently imported a file with about 600 posts in about a minute.

    can’t get mass page maker to do posts. getting this error: Fatal error: Cannot use object of type WP_Error as array in /home/attorneysync/webapps/wp_cms_cacrimlawyer/wp-content/plugins/mass-page-maker/mass-page-maker.php on line 264

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘how to upload multiple posts & assign them to categories?’ is closed to new replies.