Posts Tagged ‘wordpress’

Quick Tip: Removing all your WordPress post thumbnails quickly

WordPress is a very database centric Content Management System, and like most systems the SQL database can be the best way to achieve a quick solution to an otherwise long and boring repetitive task. Here’s one of those tasks. I needed remove all the old thumbnails, due to bad sizing and thumbnail improvements. However I have over 100 posts, so I’ll be damned if I’m going to manually go through the WP dashboard and do it. Here’s a quick and easy way to kill all the thumbnails quickly via SQL

DELETE FROM wp_postmeta WHERE meta_key = '_thumbnail_id'

This will remove all thumbnail references on all posts and has_post_thumbnail() will return false.

If you needed to run this on a specific set of rows, you’d need to use an AND clause at the end of the above SQL

Note: Always run SQL commands like this on a testing server/localhost installation and have backups ready!

Fixing some quirks with Disqus comments in WordPress

So recently I’ve relaunched my blog, with that came A LOT of offline time (busy with irl etc etc). I develop various projects on localhost environments but one thing that doesn’t play nice with localhost is Disqus comments. This is because it requires a live top level domain with the correct permalinks to each post (or discussion in this case), so of course while my blog was under development this got quite badly out of sync and started to slowly break. Putting my blog back online and chaos ensued on the comments front, its getting back to normal now, but I had quite an adventure solving some interesting quirks.

(more…)