How to fix IImage Gallery pages after update to WordPress 2.5

In one of my private blogs, I use the excellent IImage Gallery plugin to show photographs. After the upgrade to WordPress 2.5, all of the posts with galleries started failing by showing the message “There is no gallery in this post”. After puzzling about it for a while, I realized that this plugin uses the same [gallery] tag used by the new built-in gallery feature in WP 2.5, which is causing a conflict. Fortunately, IImage Gallery also allows using <gallery>, with angle brackets, which is not intercepted by WP. To change all the posts to use the alternate tag without having to edit each post by hand, I used the following command from the MySQL command line:

update blog_posts set post_content=replace(replace(post_content, '[gallery]', '<gallery>'), '[/gallery]', '</gallery>') where post_content like '%[gallery]%';

After this, all the posts worked correctly again!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s