csv 2 post updates

I’ve improved (I hope) the csv to post import plugin to support multiple categories and excerpts. csv Basically the header row should/may look like this:

wp_title|wp_post_date|wp_category|wp_category|wp_excerpt|wp_content|field1|field2

See my original post on the csv to post importer plugin to make sense of this. Please give me your feedback if you have tested it. Thanks!

Special note on importing categories and subcategories

Ok guys, here’ s the problem. One post might fall under several categories. The importer now lets you import a post under several categories. I’ve tested it and works good for me. The issue is that you might want one category to be a subcategory of another. Rather than create some funky syntax for the csv, like

wp_title | wp_post_date        | wp_category | wp_content      | cylinders | etc..
Mustang  | 2007-12-31 23:59:59 | ford > cars | <p>nice car</p> | v8        |


which could get REALLY messy if you had a lot of subcategories, I decided to make a Category Importer
This works the same way as the post importer.

  1. Download Category Importer.
  2. Unzip and up load the file called csv.php to /wp-admin/import/
  3. Prepare your csv file, here is a sample_category_file. It’s really a pipe delimited file. It MUST follow this format or it will not work. This is an example of what it should look like:

Yes this requires more work, you need to prepare a category file making sure you list the parent categories before the subcategories. After you do this, you can use the regular csv to post plugin listing all the categories you want the post to be listed under.

If you found this plugin useful, help pay for my kids college fund:


32 Responses to “csv 2 post updates”

  1. Ludo says:

    this plugin is really good it works very well. Do you think add it the importation of tags?

    thanks

    Ludo

  2. Daniel says:

    Hello Zack,
    about Field Layout Manager.
    work wp-2.5?

  3. Marco says:

    Sorry to abuse the comments field but i couldn’t find an email address.
    It’s about your plugin: Field Layout Manager. This THE most usefull thing i’ve seen on my LONG search to be able to add more fields to for instance photo’s (i’m trying to make a site in Wordpress for a friend of mine who sells cars)

    I saw your site “Encyclomoto” and followed the short setup.
    Got stuck however on point 4: (i think)
    “Add function call to template:”
    I added it almost everywhere but it doesn’t appear. Where do i put it ?
    In index.php, single.php, page.php ?
    Where exactly ?
    I realy hope you can help me because this is the only solution out there and more than 100% suits my needs.

    Kind regards,

    Marco

    p.s. I’m using WP 2.3 Dutch

  4. admin says:

    Hi Marco,

    Sorry for the delay. Instructions are here:

    http://www.encyclomoto.com/wp-plugin/

  5. Max says:

    Thanks for your great script.

    There might be 2 problems that I found:

    1. If I post to more than 1 categories, I need to have something like this in the csv file:

    …..|wp_category||wp_category||wp_category|….
    …..|cat1|cat2||
    The post will under –> “cat1″, “cat2″ and ” Uncategorized”.

    It’s strange your script assign the post to Uncategorized as well. It’s very hard for me to make all posts to have the same number of categories.

    2. The Scheduled post is not working. I mean it will appear as Scheduled post in the control panel, but it won’t show in the front page when the date come.

    I have modify the script to support tags import. If you are interested, I can email it to you. Thanks.

  6. admin says:

    Hi Max,

    Would love to see your mods. Maybe I can integrate them.

    Zack

  7. Max says:

    Hi Zack,

    Since I don’t know your email. You can get the script here:

    http://www.site2nd.org/wordpress/csv-import-to-wordpress/

    Thanks.

  8. P4C3 says:

    “Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/public_html/wp-admin/admin-header.php:16) in /home/xxx/public_html/wp-includes/functions.php on line 1221″

    Same the still problem … :( What am i doing wrong? :(

  9. admin says:

    Hi Peter,

    That’s really weird. Is that happening only on the category importer or on both?

  10. P4C3 says:

    It’s happening on the post import.
    Wordpress version: 2.1.3.
    I’m trying with this file content:
    wp_title|wp_post_date|wp_category|wp_content|Image
    3d swat|2008-05-17 10:00:59|Sport|test test|3d-swat.jpg

    (Image is a custom field, to show thombnails to posts)

  11. P4C3 says:

    Sorry, i forgot to close the tag :(

  12. Scott says:

    I’ve been looking for something like this for ages as well! I run a streetpress website and we have a large number of posts that are published on one day. This will allow me to streamline my workflow and save a lot of tedious repetition! I’ll even be able to add more content such as the CD reviews. Hooray! I was wondering tho’ is it possible to add an authour field and post status (published, pending, draft) in the CSV file or does that require changing the csv.php?

    Cheers,
    Scott

  13. Scott says:

    I’ve just done my first test with CD reviews and WOW – so quick, but I’ve found the text in wp_content will stop after a quotation mark or an apostrophe. Might this be because they are special characters?

    S

  14. Sven - China says:

    Hi,

    nice plugin, thanks a lot!
    Just a short note related to your CSV example file. Could you please change the following line:
    California|Unites States|
    into
    California|United States|
    That made me think for a couple of minutes ;-)

    Thanks and cheers,
    Sven

  15. THANK YOU
    Simple, effective, powerful, solid plug-in. Every home should have one.
    http://www.diamondgeezer.com

  16. Kyle says:

    Thank you! Great plug-in. My post content contains ’s and the content is truncated after the ‘. Any suggestions?

  17. Hi;

    First thanks a lot for the plug-ins they are great!

    I have a question about the Field Layout Manager and it’s how to use it after step 4, how can call the extra fields within the post template.

    Thanks a lot

    Jose

  18. Bob says:

    Hi,

    tried to install it (uploaded the csv-categories.php into the plugins folder just like usually), but it doesn’t show in the plugins dashboard for some reason?

    Any ideas how this could be fixed? (I’m running WP 2.6.2)

    Thanks!

  19. Bob says:

    Hi Zack,

    just read your reply on the other post.
    Uploaded it in the wp-admin/import folder. and it’s working great now! Thanks!

    Bob

  20. Joel says:

    OK, I just realized how dumb my last question was, since the time-out does not occur on the upload to the server, just the import to the db. Is there anything to do about the timeout issue?

  21. Adrian says:

    The latest CSV import with multiple categories doesn’t have a wp_excerpt field as showm at top of post, and there should be no spaces between pipe delimiters. Also, I would update version number and link from original post.

  22. tecko says:

    Zack,

    I’m having some real problems with line feeds in my CSV file causing records to be split into multiple posts. Is there a fix?

    THANKS

  23. perozzi says:

    Hello Zack, nice plugin; is there a way to import sub / parent categories using your tool?

    thanks in advance!

  24. Panda Save says:

    Hi, is there anyway to run it so when I run the import again then it will overwrite the item based on it’s title I have already instead of creating a new post?

  25. Fredrik says:

    Thanks for a great hack. I have a problem with [caption] tags getting lost from my texts. Is it a know problem/limitation with cvs2post or are they eaten somewhere else?

    (sorry if this is an rtfm)

  26. I am surprise that when I installed this plugin with in new Wordpress 2.7, I got following two problem. I resolved them my surprise is that nobody mention about it, even in january people have done comments.

    1. Problem one is head is class name:, instead it should be Plugin Name:, so wordpress 2.7 may see this plug and give option to activate.

    2. When I activated, it gave error of undfined call to register_improter, so I have to put following line on top of importing registers.

    efore this line $csv_categories_import = new CSV_Categories_Import(); I have added following line.

    include_once(ABSPATH . ‘wp-admin/includes/import.php’);

    I think it is problem of import.php which may have changed its location.

    But finally when I tried everything was great.

    Thank man for your good programming.

  27. jmartin says:

    Anyone find out what happened the excerpt as requested by tecko on 12/2/08? Would love to be able to add the excpert at the same time as the rest of the post.

  28. jmartin says:

    Okay so it was posted by Adrian on 11/13/08

  29. Walter says:

    Hey Zack, when I import my categories and sub categories, and click on the sub categories in wordpress, the parent categories don’t show up as parents of the sub categories. I have wp_category for my sub categories and wp_parent my parent categories. Also I don’t get it, when using csv to post, you mentioned use: “wp_title|wp_post_date|wp_category|wp_category|wp_excerpt|wp_content|field1|field2″

    which one of those wp_category is supposed to be the parent category? Am I doing something wrong?

  30. Aaron says:

    Using WP 2.7.1 everything seems to import fine. I just can’t see the sub categories showing up in /wp-admin/categories.php . What is interesting is that if I delete the parent category then I can see the subcategories in the list. This is what I imported:

    wp_category|wp_parent|wp_description
    Alabama||
    Anniston|Alabama|
    Birmingham|Alabama|

    If I delete Alabama then I can see Anniston and Birmingham in the list…

  31. Hey

    Don’t know how to put this to you really but I’ve just launched CSV 2 POST Plugin…

    http://wordpress.org/extend/plugins/csv-2-post/

    It’s home page is…
    http://www.webtechglobal.co.uk/wordpress-services/wordpress-csv-2-post-plugin

    I done a search on Google to see if its been crawled and found your plugin!!! I created the plugin for myself in the first place but decided to release it. I never found your plugin through Google somehow either.

    It do feel bad because it seems you took the name originally however you did not secure the name on the official wordpress plugin directory which is what I was going by.

    I considered changing name however this is a much longer task for me than it would be for you so I’m not going to. I don’t even know how to do that on the WordPress directory.

    Thought I would deliver the news so its not so much a shock. I’ve just got out of Uni so I’m really new to all this.

    Ryan Bayne
    WebTechGlobal

  32. Laurent says:

    Hello,
    Sorry I post here cause I couldn’t find your email adress.
    I’m currently trying to import french text into wordpress but special caracters are not displaying.
    Is there anything I do to make it work ?
    Thank you.

Leave a Reply