A few days ago, I saw someone posted on Twitter a question about running WordPress on Windows Server. Since I had done this for a few sites, I responded with my thoughts and tips. Another suggested that I post those here, and so here I go.
WordPress is a blogging/content-management platform that has been around for a while. It has been gaining more in popularity for general purpose content sites over the past year I’d say, but is primarily seen as a blogging platform by most. Even though I use Subtext for my platform, I have to admit that if I hadn’t already started using Subtext, it would be really hard to sway me away from WordPress. It’s just the killer app for blogging. Why? Because of the immense ecosystem of people using it, there is pretty much a plethora of plugins, themes and tools for it.
WordPress is a PHP application and mostly used on Linux environments. But guess what—PHP has been running on Windows for years. In fact, our IIS team created a FastCGI implementation for IIS to make PHP applications even run better on Windows. So here’s how I got started…
First you obviously need to install the pieces. I’m assuming here you have access to the actual server. WordPress requires PHP, MySQL and the WordPress bits themselves. You can certainly hunt around for those yourself, or you can use the Web Platform Installer from Microsoft and install WordPress on your box in about 15 minutes including download time. No hunting for the right bits, no tinkering for the right configs. Just install WebPI, select WordPress and go. Honestly, this is the best way to get it started on Windows.
After installing you should be up and running with a starting site. Login to complete the process.
Decide on your permalinks or ‘pretty/clean URLs’
Here’s the main issue with WordPress on Windows. By default Windows 2003 is still using ISAPI filters to process requests. What this means is that it needs something to trigger the subsystem it will use to render. In this case it’s .php for the php files of WordPress – IIS then knows to use PHP to render the files/logic.
However because of this the default pattern of WordPress URLs on Windows 2003 will be <domain>/?page_id=12345. For everything. That isn’t very clean or friendly according to the SEO experts.
Now if you are installing WordPress on Windows 2008 and IIS7 the following does not apply to you. IIS7 actually has built-in support for this and WordPress current versions recognize IIS7 installs and do the appropriate configuration for you!!!
If you want your URLs to be like <domain>/my-cool-page-title-name then you’ll have to do some hacking. You can do a ton of high-tech stuff including actual new ISAPI filters to do some URL rewriting. I chose the low-tech way: 404 handler. You see if someone requests <domain>/some-page-name IIS won’t be able to find it and will generate a 404 message. Luckily YOU control that 404 message. I use a very simple 404 handler that I found online and modified ever-so-slightly. You can download mine here: wp-404-handler.renametophp. Simply put this in your WordPress root folder with all the other PHP pages. Now in IIS Manager you’ll want to configure the IIS site to use your new custom 404 handler.
Just click the current one, choose URL and then type /wp-404-handler.php in there and you’re good to go. Now you can go to the Permalinks section of the WordPress admin and choose “friendly” URLs. Here’s what I typically use:
Now anytime someone requests a friendly URL it will actually hit your 404 handler first, determine the right place and render the content – but keep the friendly URL in tact to the user!
At this point you can close your remote server session – all other routine tasks can be done via the web admin console.
Find Awesome Plugins
Finding plugins is VERY easy in WordPress – it’s in the administrative console of the app:
Search for what you want and you can install right from the admin console – no need for FTP and unzip, etc. Here is a list of my default plug-ins that I install (all of which you can search via your WordPress installation for more details and to directly install):
- Akismet – comment spam tool
- All-in-One SEO pack – tools for enhancing your SEO metadata for your posts/pages
- Contact Form 7 – a typical contact form engine
- Google XML Sitemaps – an auto generator of sitemap.xml files for search engine indexing
- Internet Explorer 6 Upgrade warning – you know, to support the death to IE6 cause :-)
- Really Simple Captcha – for contact forms to prevent robots.
- WPTouch iPhone Theme – if you want an iPhone friendly theme
- Silverlight for WordPress – to embed any Silverlight XAP in a post/page
- Silverlight Media Player for WordPress – uses the Silverlight Media Framework for embedding video or IIS Smooth Streaming content.
There are TONS more, but these are my default that I always put on every site first. If you want Twitter and other types of integration, they are there…just search for them. There are currently over 9,500 plugins to choose from…amazing!
Find Awesome Themes
Whatever you do, don’t skip this step. Don’t keep the default WordPress theme – it’s like any other default user interface thing on any software…it sucks. Like plugins, there are a plethora of places to get awesome themes. Here’s my default go-to list:
- WooThemes – these guys are sweet. Their menu system is actually going to be a part of WordPress 3. Most of their themes are premium paid themes, but they do have a few free. If you want high quality, check out these guys.
- Themeforest.net – a larger selection of theme from various user-contributed designers and developers. These aren’t free either, but for < $40 you can have a great quality looking theme.
- wpsnap.com – these are free themes with community licenses. There are some gems in here, but most are lower quality compared to the previous two recommendations.
- WordPress theme gallery – explorable from the WordPress admin page in your installation there are a few in here (some repeats from wpsnap.com). Usually aren’t the best to be honest. My favorite for a cleaner default look is Journalist – it’s very basic, but clean looking and professional.
There is no excuse to have a crappy looking WordPress site no matter if you have no money, doing a blog, doing a content-managed site, etc. No excuse. Spend 30 minutes and find a good template. Guess what, it installs from the web admin console as well!!!
While WordPress uses a web-based interface for authoring content, it isn’t required. Windows Live Writer understands the WordPress API for both posts and pages and can be used as a rich client tool for authoring content. It’s awesome together and I use it exclusively to author content for my WordPress sites.
Gotchas for running on Windows 2003
Ok, while I’m sure there are others, I really only found one big gotcha while running WordPress on Windows 2003 (that shouldn’t apply to the IIS7/Windows 2008 installations). This involves plugins that do form posting. A good example is a PayPal plugin that is a complete shopping-cart for PayPal (yes it’s in the plugin gallery and free). Most plugin developers assume your installation is likely Linux. If this assumption is made, postbacks for some plugins might not work if you use the clean/friendly URL 404 handler I talk about above.
Each plugin is going to be different, but you’ll likely have to modify the post action of that plugin to point more directly to that index.php?page_id=XXXX where your content page is. I’ve only had to do this twice and It’s relatively painless. One thing to keep in mind though is that as plugins update (you are alerted in your web console if a new version exists), your changes will likely be overwritten, so document them!
Extend WordPress yourself!
Since I’m a Silverlight guy, I wanted to make sure there were some good Silverlight plugins in the gallery. The plugin developer process is very PHP driven so if you don’t know that, follow the CASE methodology (Copy Always Steal Everything). You can learn from others. I created my WordPress plugins for Silverlight very quickly.
Microsoft is also doing more with WordPress through the MIX labs team. Check out their information on http://wordpress.visitmix.com for other tips and how, if you want, to run WordPress on SQL Server as well!
WordPress is awesome. WordPress on Windows is also awesome. Windows 2003 takes an additional tweak, but other than that it is very simple to get running and take advantage of this ecosystem. What other WordPress on Windows tips do you have?
Hope this helps!