• Hi,

    This plugin is great. Seems to do exactly what i want. One question. All my posts use two plugins. Post Expirator allows each post to have an expiration date and pages link to lets me link the title to a different page. For some posts I need to insert two custom fields, an expiration date and a URL. How do I go about figuring out what the titles should be on my CSV file to import these two fields for each post?

Viewing 9 replies - 1 through 9 (of 9 total)
  • According to https://www.ads-software.com/extend/plugins/csv-importer/other_notes/

    Columns csv_post_title, csv_post_post, csv_post_excerpt, csv_post_categories, csv_post_tags and csv_post_date will be imported as post title, body, excerpt, categories, tags and date, respectively. All other columns will be added as custom fields to the post.

    Thread Starter gcarson

    (@gcarson)

    Thanks for the reply. I wasn’t sure how to format the column heads for the custom fields. As help to others, I figured out how to get the ‘pages link to’ custom field inputted. I checked the .php file. For instance, this plugin has you enter a URL when you create a post. I looked for the part of the code that to see what variable was used when a URL is inputted for a post. I used the same variable as my custom field column head and it worked. Now just trying to figure out how to enter the date for the post expiration. It recognizes that there’s a date but the date that gets imported is incorrect.

    Here’s how a date is stored in the posts table
    For December 02, 2008 at the time of 16:33:13

    2008-12-02 16:33:13
    Thread Starter gcarson

    (@gcarson)

    I tried every possible combination of the date to get it to work. Turns out the plugin uses ‘seconds past 1/1/1970’ as their date format? Not sure how common this is in WordPress? But might be helpful for others. Since I was uploading my posts via a csv file, I simply did the following equation in Excel, in case others were interested:
    Cell A1 – 1/1/1970
    Cell B1 – 12/31/2009 (or whatever date you want)
    Cell C1 – = (B1 – A1)* (60*60*24)

    This first calculates the number of days between the two dates, then multiples that by the number of seconds in a day to get the number of seconds between the two dates. I’m sure it might need to be tweaked if you need an exact time down to the minute? But for my purposes, within a day was good enough.

    Hope this helps anyone else.

    Good to know. Thanks for the feedback.

    [moderated title]

    Great work. Very useful. One thing you may consider adding to the next version is the additional column: post_author.

    I’ll probably be modifying your current version to include that in the meantime. Thanks.

    ready2remodel: You can send me a patch, if you want. My email address is in the source.

    I tried what gcarson said, but didn’t work for me. Tried all other formats as well. Even the CSV example doesn’t give me the exact date. It always posts as today.

    I wonder if it’s because I’m using WP3.x.

    edit: I tried on 2.9.2 and got the same error.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘CSV Importer Custom Fields and date format’ is closed to new replies.