I'm currently in need of a wordpress plugin for mapping domains to subdomains for a site that uses cloudflare, and so want to put some thoughts together on the kind of options I would want/need to do this.

There are a number of wordpress plugins that already map domains, but none of them work well with cloudflare. This is because the mapped domain needs to be setup with a cloudflare account, and the current plugins all require a DNS A record to point directly at the server that is hosting wordpress. The new plugin would need to use the modified sunrise.php file that either of these plugins use to serve the correct blog content depending on which domain name the server receives.

The plugin would need to either create an entry for a website at cloudflare and create a DNS A record that points to the wordpress server, or notify the network admin so that the records could be setup manually. Ideally this would happen automatically using cloudflare's API - A network admin setup screen would need to hold the following details:

  • Server IP to use for the DNS A record
  • Cloudflare API credentials
  • Cloudflare account type to use
  • Cloudflare nameservers - to let the user know what nameservers to use

The details would be stored in network options so that they are available for all blogs.

Cloudflare has different options that can be applied to websites in a single account. It is free to add a website and use the basic options, but if you want to use SSL, Image optimization, better caching and other goodies, then it is $20 for the first website and $5 for subsequent websites. For the multisite installation that I run I want to have different levels of membership - a basic option costing $7 that doesnt allow domain mapping, and a more advanced that does allow domain mapping. I already use the cloudflare plugin that adds DNS CNAME records each time a blog is created, and I have the main blog on the on the plan that allows SSL so that all domains can use SSL. I want all mapped domains to use SSL as well. My first thought about making this work is to have two plugins - one to hold the details in the list above which is only visible to network admin, and a second plugin that can be enabled based on the user's membership level so that they can enter their mapped domain name.

Since the user would be giving up DNS editing, there should be basic options for adding DNS records in the user's control panel for things like MX, TXT etc.

Each time a user requests to map a domain name, or add a DNS record, an entry should be added to a single table that holds the blog id, DNS record information and date requested. This table could then be polled for new records that need to be entered into cloudflare using the API, or cloudflare could be manually be updated by viewing the list of changes in network admin.

Anyone got any other ideas or thoughts?


It's been nearly a year since my last post, and many months since the plugin last had any updates. This post outlines the new features in version 1.00.03:

Removing data from the redirect log

The way that the plugin works out how many redirects there are for each address is by logging each redirect and counting the redirects on the link and address pages. One of the things that I didnt account for in the previous version was how to delete or reset this data. Now, when you uncheck the option "count redirects" on the link page and save the options, the entries from the log are removed. Re enabling this option will effectively reset the counter.

Case sensitive keyword/phrase searching

This is a feature that had been requested a little while ago. It enables keyword/phrase searching to be set to case insensitive - this means that the keyword "television" will find and replace "Television" (and other combinations of upper/lower case) in blog posts.

Redirects graph

Under the "count redirects" option on the links page there is now an option to show a traffic graph. Once the check box has been checked and saved, the graph will show at the bottom of the page. This shows the redirects for the current month.


Affiliate link cloaker WordPress plugin

July 11, 2011

Affiliate link cloaker is a free WordPress plugin that can geo target cloaked affiliate links. This plugin has the capability to generate a link like http://www.brewsterware.com/recommends/amazon and have visitors from the USA click on the link and get sent to www.amazon.com, visitors from the UK sent to www.amazon.co.uk and so on. In addition to this, […]

Read the full article →

Region detect wordpress plugin

May 22, 2011

Region detect is a plugin for WordPress that detects the country that the current visitor is browsing from. It can display the country to the user; something like: Hello visitor from %%COUNTRYNAME%% This is done by using the codes %%COUNTRYCOD E%% and %%COUNTRYNAM E%% in your posts (take out the spaces). The plugin makes the […]

Read the full article →

WordPress autoblogging plugin

December 14, 2010

So, further to my previous post I now have a fully functioning autoblogging plugin for wordpress based on all of requirements of using cron jobs and other bits. It wasnt as easy as I initially thought it would be as I’ve had to pretty much touch every line of code in the software – I […]

Read the full article →