Changing URLs in WordPress MySQL Database

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

This is a very common task when developing WordPress sites and there are loads of sites that show this query.

The problem is, I suffer from some kind of Google search blindness and it always takes a few tries to find the right page. Much easier to put it on my own site.

Installing PHP7 mcrypt on Debian

I’ve run into this problem a few times when setting up development stacks for Laravel, OpenCart and some other frameworks – they require the mCrypt PHP extension, but it is not included in Debian 8.

After a few failed attempts and some Googling, this seems to work for me:

apt-get update
apt-get install mcrypt php7.0-mcrypt
apt-get upgrade

Of course, you need to be the root user to do this.

Web Fonts Article

Very interesting article on A List Apart – Webfonts on the Prairie.

It’s a discussion about the adoption of webfonts, whether they should be used and how to overcome some of the problems they can cause (slow load times, etc.)

There’s an interesting quote from web designer Adam Morse:

There are a lot of arguments around why you should use webfonts. In none of those arguments, have I heard about a single problem being solved for users.

Web designers and developers can be dazzled by new technologies and forget about the ultimate aim – usable and functional websites for real people.