Batch Edit Categories

Apr 8th, 2008 | Posted in Asides | By Eric Hoefler

Update: If you’re using Wordpress 2.7 or higher, this plugin is no longer necessary. You can batch edit categories now on the “Edit Posts” page. Select multiple posts, choose “Edit” from the “Bulk Actions” drop-down, assign the new category in the “Categories” column, and click “Update Posts.” (You can also batch assign tags and perform other batch functions this way.)

As I settle into this new blog space, I find I need to make some changes to my categories. I’ve been putting it off, though, because I’ve been dreading the laborious task of opening each post to make the changes.

Tonight, I found Rob Miller’s1 plugin “Batch Categories (v1.4)” that allows for the batch editing of categories and tags on posts.2 It’s made the “cleaning up” much easier, and I highly recommend it if you have to do any category or tag work on a large number of posts.

I did have to make two changes, though. First, if your category contains anything other than letters, it will return a “no posts found” error. For example, I had a category called “Reading/Writing” that I had to rename “Literacy.”

Second, if you have a large number of posts in a category, the default placement of the pagination will disappear (because it will be too long for the cell provided for it). I fixed this by editing the “admin.php” file and moving the pagination onto a separate line in a new table.

The edited version of the file is here: admin.txt
(Save this as “admin.php” and replace the “admin.php” file in the “batch-categories” folder.)

If you find Rob’s plugin useful, be sure to leave a donation for his excellent work.

  1. Rob is also the creator of the excellent “Now Reading” plugin, which I used for a while before moving all my book-related info to LibraryThing. [back]
  2. as of Wordpress 2.5 anyway [back]
| Print Post (Text Only)
Tags:

7 comments
Leave a comment »

  1. Glad you like it! I’ll try and fix that first issue, sounds like an odd one.

    Rob’s last blog post..Bosnia: A Short History

  2. Thanks again for your work, Rob. I’ll keep an eye out for any updates. Still, it’s a great tool and made updating this site much simpler than it would have been!

  3. Hm, seems to me that the isn’t reachable:
    the error:

    “Fatal error: Call to undefined function: add_action() in /home/erich4/public_html/blog/wp-content/uploads/2008/04/admin.php on line 6″

    Very much looking forward to use your update of Robs plugin!

    Niels Christian Nielsen’s last blog post..Rorty on Truth, metaphor and common sense

  4. Im refering to the file admin.php , sorry

  5. Sorry about that, Niels. I forgot that I can directly deliver a PHP file through Wordpress. I’ve converted it to a text file (admin.txt). Just save it as a PHP file and replace the one in the batch-categories folder.

  6. Might it be so that characters as æ ø å ä ö will perform same ‘error’:
    “No posts matched that criteria, sorry! Try again with something different.” ?

    I just uploaded your file, and it still says same ‘error’. But my case is exactly that I have æ ø å in my titles.

    Is it around line 150, that there should be edited?

    Niels Christian Nielsen’s last blog post..Rorty on Truth, metaphor and common sense

  7. Nope … around 305; create a separate “div” around the pagination function, and give the div: id=”actions” class=”tablenav”

Leave Comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By commenting here, you agree to license the original content of your comments under the same license as this blog (Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License). I reserve the right to remove comments that are commercial in nature, that are clearly off-topic, or that contain personal attacks. If you have questions or encounter problems, please contact me.