How to change a multisite primary domain

WORDPRESS-black-ink-grunge-stamp-textures-icon-social-media-logos-wordpressIf you want to change the primary domain of your WordPress multisite installation, there are 5 values to change. There is no need to perform a database dump. This is actually frowned upon, as WordPress stores serialized data in the database, and altering it can cause corruption. Here is a list of the 5 main tables and options that need to be changed (note that we’re assuming your table prefix is “wp_”. If you’re using a different table prefix, replace “wp_” in the following table names with your prefix):

  • wp_options: options named “siteurl” and “home”
  • wp_site
  • wp_sitemeta: the option named “siteurl”
  • wp_blogs: any entries in the “domains” column that have the old domain name
  • wp_#_options: Each sub-site will have sets of tables that correspond to the blog_id in the wp_blogs table. You need to go to the wp_#_options table, where # corresponds to the blog_id, and update the “siteurl” and “home” settings in that table.

Continue reading

Moving posts between blogs

I have a multisite setup running here but I largely use one blog for just about everything, ranging from (things like this) WordPress, to applications and shortcuts, through to personal posts about travel, and my family and children.

In the multisite setup I have several blogs. Mostly the are concepts or ideas that never really took off (like dav3 on wordpress).

It has now got to the stage where I want to merge a few of these together, and maybe separate out some others (more about the merging all the blogs into just two or three—probably two).

I’ve been thinking in my head how I would achieve this and finally today I did a google search on it. The very first post came up with what sounds to be a solution and breaks it into three parts, and I’m going to add a fourth.

  1. On blog 1. Export the posts.
  2. On blog 2. Import the posts.
  3. On blog 1. Create permanent redirects for the pages you now have on blog 2.
  4. On blog 1. Delete the posts you no longer want there.

You probably didn’t even know you could do this. I know I didn’t. I know that I’d seen the Tools before, but I’d never really given it consideration. Until I read Andreas Rennick’s post over on

I did add step 3 just on the supposition that someone finds your post to the old blog somewhere but can no longer find it because you have deleted it. Setting up a quick redirect to handle such a scenario will 1) get them to the post/place they need, 2) allow them to find more relevant stuff in your new blog, and 3) help to update the search engine that got them there in the first place.

Thanks Andrea for making the simple so obvious.

I’ll post again, or update this post when I do it myself with how (easily?) it went :)


wordpress 3.6, blockui.js problem and sidebar login

I upgraded to WordPress 3.6 the other day and immediately got the flowing error:

“error 3.6 blockUI requires jQuery v1.2.3 or later!”

Actually, that’s not the exact error I got, the exact error included version numbers of the current and the required versions. The odd thing being the current version was higher than the required version, but computers (and how they read numbers vs strings) got it all wrong.

I have a ton of plugins installed and took a stab in the dark at sidebar login (it’s one of the few that I use across multiple sites).

It was updating this plugin (for me) that resolved the issue, mydomainwebhosting, mysql and localhost

I recently thought I would try a new webhost. I’ve been with my current one for a number of years, and the relationship, whilst not perfect, has stood the test of time.

I have opened up a web hosting account, mainly because the second ever domain (and every other–bar one–domain purchase has been through them). As a Domain Name Service, I haven’t had much to gripe about. In fact, the only thing I would like to see is a way to have a permanent number of domains show in the backend for administration. The default is 20 and I have more than that many domains, so to see all my domains I must reload the page with a higher number of domains to show… Nit picky, but it all takes times…

I have digressed…

I recently installed a wordpress installation on a mydomainwebhost. Whilst it was reasonably painless (it wasn’t without pain), it worked. I needed a call to customer support for a PHP4/5 support query, but otherwise, the install went ok. Until it came time to put in the MySQL server name.

Have you ever tried searching google for things involving “mydomain”? You get 1000’s, 100,000’s search results where people are asking questions about their domain and when they quote it, what do they use as an example domain name? “”. Which essentially makes it impossibly hard to find suitable and proper answers to your problem.

What did I find? doesn’t use the default “localhost” name for their mysql database server. It uses a lesser known (and hard to find) name of: ““. That is the name I found elsehwere on the net, and it worked for me. It SHOULD work for you.

WordPress and “You do not have sufficient permissions to access this page.”

W LOGOUPDATE: It’s amazing the number of hits this page gets, where people get this (or a very similar) error and this has helped them. I’m very glad this helped, but I just want to add, this page is more than 3 years old now and although the logic is simple here, remember it is old and “things” may change (eg, plugin folder name, or how plugins are managed to name just two). I hope this helps you. Good luck

Years ago I hand-coded my first website, and sometimes I still do the odd bit of dabbling like that. But these days there are so many great content management systems (CMS) out there, that really, why bother. I use to use Druple, and I have nothing against that, but a while back now I migrated to WordPress…. All was fine until…

The other day I upgraded using their backend and I lost all permissions. Any guest could use the site as normal, there were no problems there, but I couldn’t login. It took a few days searching on the web (without luck) and eventually, I jumped back into cpanel, and phpmyadmin and started digging.

The solution was a lot simpler than what I had envisioned.

During the update process, one of the plugins caused havoc in the backend, and when trying to display the dashboard, the plugin was breaking privileges. First I had to work out, which plugin it was, and if in fact if it was a plugin that was the cause. As it turned out, it was, and this is how I found it:

1. created a new folder called “old_plugins” *
2. moved all the plugins from the “plugins” folder to the “old_plugins folder” *
3. logged in – sweet – I was allowed and all appears good
4. visit the plugins page (you will get a warning that your plugins have been deactivated since they can’t be found.
5. put the plugins back into their original directory *
6. reactivate each plugin until you find the faulty one. For me it was a google reader plugin for the dashboard, which I never used anyway – so it’s now gone!

Once you find the faulty plugin, you’ll get the permission error again, simply go back to your ftp or file manager (I just used cpanel) and move the faulty plugin out…

* You could probably have just renamed the plugins folder, visited the plugins page, re-renamed the plugins folder, and gone through the reactivation process that way, this is just the way I did it.

also (cross)-posted at

WordPress iPhone app – crashes ** FIXED **

Today I downloaded the WordPress app from the Apple App store, for the iPhone. I have been looking forward to this for some time since that although my site looks good on a mobile device, it doesn’t lend itself to be uploaded to from a mobile device.

Until now… Enter the WordPress application from the app store. errrrm… ok… But it didn’t work for me. It would consistently crash and restarting the app would just crash immediately. I determined this was because I am running a WordPress multi-site. Whether it is or not, I found the fix:

Please open “your/wordpress/directory/xmlrpc.php” in any text editor, and rewrite the line 477,
'blogid' => $blog_id,
'blogid' => (string) $blog_id,.
Yeah! Now, you can use WordPress for iOS!

Now I’m a happy camper…

BTW, I found this solution here, look for the first comment dated 05/07/2010.

edit: today I upgraded wordpress to the latest version 3.01 and I checked the above file, it has not been fixed. If you install the 3.01 update, you will also need to re-edit and include the string cast for the blogid.

on a side note: I also use tumblr, and the tumblr app for the iPhone is equally FANTASTIC! Highly suggested and recommended if you use tumblr.

Subpages widget

Alper Haytabay had created a subpages widget that was pretty much exactly what I was after (for another site I was working on). I found one flaw that prevented the widget from displaying nicely. In fact, the flaw didn’t appear to come from the widget but rather some other anomaly I could not determine the origin of.

The problem only occurs when the widget is displayed in it’s own sidebar. If there are no sub-pages to the current page the sidebar (which should be empty – and hence not displayed) appears. I could not seem to find a way to override this so I created a little addition to the existing code. If there are no subpages, display a small (user-defined) tagline instead. I made one other change to include this widget on all pages/posts so that if there are no subpages, the tagline will always be present.

I don’t use this widget on this site, but an example appears here

The widget (my version) can be found here: subpages-widget