Using Swedish characters in WordPress

2015-09-30

Here’s a quick WordPress tip. Not everyone wants to write their blog posts in english. For example swedes use characters like å, ä and ö, and by default WordPress handles them like a, a and o. å, ä and ö are the last characters of the swedish alphabet so that messes up the order when you try to sort posts alphabetlically. Here is a quick fix you can do to make sure your WordPress installation can handle swedish characters.

So first, you can add this to your wp-config.php

define('DB_COLLATE', 'utf8_swedish_ci');

And then you run this command in your database, for example in phpMyAdmin.

ALTER TABLE wp_posts CHANGE post_title post_title TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci;