Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Bulk edit date on posts WordPress

  • SOLVED

Hi
I am trying to find out how to bulk edit post-dates
any ideas???
I have been looking for plugs and hacks but so far no luck

thanks!
Jacob Tekiela

Answers (2)

2012-05-14

Francisco Javier Carazo Gil answers:

Hi Jacob,

You can do it directly in SQL.


Francisco Javier Carazo Gil comments:

You have to do an UPDATE to wp_posts, exactly to the next fields: post_date (in your time zone) and post_date_gmt. You need a condition and run the query:

UPDATE wp_posts
SET post_date = 'YOUR_VALUE', post_date_gmt = 'YOUR_VALUE'
WHERE YOUR_CONDITION


Francisco Javier Carazo Gil comments:

You should use phpMyAdmin or any other MySQL client to do this into the database that WordPress use.


Jacob Tekiela comments:

Thank you - had hoped to be able to do it from the admin


Francisco Javier Carazo Gil comments:

If you need further information about it, ask me.

2012-05-14

John Cotton answers:

Francisco's is a good solution and certainly the quickest way if you've got fairly simple changes to make.

If you changes are more complex, then a little bit of PHP might help (using $wpdb), but ultimately you'd be mixing it with SQL so you could just go straight there.


Jacob Tekiela comments:

thank you for your answers, I had hoped to do it inline from the admin

have seen tutorials where you can add NEW custom-columns, bulk-edit and save with AJAX - but I simply want do batch edit the <strong>existing</strong> date

I have many posts

hmm


John Cotton comments:

<blockquote>have seen tutorials where you can add NEW custom-columns, bulk-edit and save with AJAX - but I simply want do batch edit the existing date</blockquote>

Sure you can do that, but the code needs creating to do it.

There may be a plugin that does this but in code terms adding columns and capturing the ajax return for bulk rows is not a simple, 2 minute thing. If you had this requirement regularly, it might be worth the element to create the various bits of code necessary. But if it's a one-off thing, go with the SQL option.