Using WordPress on real websites

WordPress is a super piece of software. It has made it easier and quicker to get a website up and running than any other content management system out there. It has a great range of plugins and themes, and is reasonably easy to add your own too.

That said, there are a couple of issues that I think make it a questionable choice for using on an important website.

It works fine if you deploy it to one location and just build everything there. However, often I will have a development version, a staging version and a production version. This allows me to pass a website through each stage while making sure it is working.

With WordPress, this is difficult.

You need to put the site URL into two different places in the config. This means that you have to update these values every time you deploy content to another server. So for example a typical use case would be to copy all your production data over to staging so you can perform major testing, and then potentially copy it back again. Or you want to develop the site locally and then push everything up to your server.

Unfortunately WordPress uses these URLs for the login process, so you cannot just log in and change them in the admin panel because you will not be able to get in. You have to do it via a script or by editing the database directly.

Secondly, it uses absolute URLs everywhere. Every time you upload a piece of media, or a post, it will store a URL for it in the database with the hostname included in it. When you insert the media into the post, it puts a absolute URL and SRC in there too.

This means that you have to do two things. Firstly, take our all the hostnames from the SRC and URL HTML content that WordPress generates every time it inserts a piece of media for you.

You also have to update the database to change all the URLs in there too. There does not seem to be any support to do this at all. I had to write a little plugin to change these. Arguably, you could use this plugin as well.

I am not sure why it does this. There does not seem to be any compelling argument to use absolute URLs. I had a look around for one, and the closest article was by Joost de Valk, none of which I think really stand up (certainly not in comparison to “is your site probably tested?”).

As pointed out here, if you really need to use absolute URLs, you could implement a short code to allow it to remain dynamic.

WordPress is a super piece of software, and indeed runs my blog. But I think it has it’s place in a certain set of use-cases and large production systems do not seem to be one of them.

Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

Tags: ,

This entry was posted on Wednesday, May 21st, 2014 at 11:31 am and is filed under Thoughts. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.