Update WordPress author

Like me, many of you may have installed WordPress and begun using it as the default administrator account - admin.

The problem is, you'll later wish you'd created your own user account, which would have been tied in with each of your posts and comments. Up until 2 minutes ago, all my posts were created by admin and all comments written by me had the name admin assigned to them.

There are several options if you're in this scenario - including creating a new account and ensuring all future posts/comments use it or updating all existing records with your new account details. I opted for the 2nd option and began by working out what users were currently in the slickhouse WordPress database:

SELECT ID, user_login FROM wp_users

This will return a list of all IDs and user_logins from the wp_users table within the database. In my case, slickhouse has just the one user - admin. It's then a case of updating the user as necessary. Start by selecting all columns for the previously returned record (which had an ID of 1):

SELECT * FROM wp_users WHERE ID = 1

This returns all columns for the user admin in my case. From the results, I chose to update the following columns:

To do this, you'd run the following SQL command:

UPDATE wp_users SET user_login = 'example', display_name = 'example', user_firstname = 'example', user_lastname = 'example', user_nickname = 'example' WHERE ID = 1

Replace example with what you'd like each column to be updated to. As we've just updated the existing user, there's less work to do - the wp_posts table doesn't need to be touched, as it references the wp_users by the ID field, that hasn't changed. However, wp_comments is a different story and does need updating:

UPDATE wp_comments SET comment_author = 'Example', comment_author_email = 'example@example.com', comment_author_url = 'http://example.com' WHERE user_id = 1

This will update all comments that are associated with your admin account, to the new details. Replace example in the above with all of the information you updated the admin user to previously.

And that should be it! I carried out all of the above using the MySQL Query Browser, which can be downloaded from the MySQL site. One word of warning - ensure you've got a backup of your database prior to carrying out any of the above. Make a note of what you update, so that if you do run into difficulties you can update the records back to what they were originally - or if all else fails, restore from your backup. Again, a backup can be accomplished using the MySQL Administrator.

comments Posted: Monday 22nd December 2008, 17:53pm
Categories: Slickhouse, Web
Tags: mysql, sql, wordpress

New Hosting!

For the past 5 or so years, slickhouse.com has been hosted on a shared Linux server, provided by UKHost4U.

While the hosting has been good, I've grown out of using a shared web server and all of the limitations that go with it. So, over the past year I've developed my own dedicated web server, with a twist - a) it's Windows and b) it's hosted at slickhouse itself.

For those of you interested in running your own web server, it's actually a fairly straightforward, albeit time-consuming thing to do. And it proved successful - as you are reading this served up by the new server!

The hardware:

The software: Alongside the web server itself I used the following: As slickhouse.com uses WordPress, I found Keyboard Face very useful to ensure the permalinks worked correctly within IIS. The script itself is very simple and works well with most of the posts/pages on the site. The only issue I've encountered so far is with inTouch, which I use for the AJAX contact form, hence it now being reference via its Page ID. The article Installation Issues on Microsoft IIS is also a good read for those wanting to get WordPress up and running on Windows. DSL/Cable Webserver is another good resource, which documents the whole process to run your own web server from home.

I chose to use Microsoft's Virtual Server 2005, as it allows me to run several operating systems on the same machine. Currently the server only has the host and virtual operating systems, but I'll be expanding it with a development server soon. Another advantage to going virtual, is that I can easily copy the whole server from one physical hardware platform to the next. So if a catastrophic failure occurs, I can quickly transfer the image of the server to another hard-drive, or Virtual Server.

This configuration has so far proved to be a lot more beneficial to my previous shared hosting solution with UKHost4U. For a start, I'm in complete control of the whole solution - from domain registration, to configuration of the server itself. Also, it means I'm not limited by the assigned disk space and bandwidth provided with my shared hosting package. My ISP at home is Virgin Media, who over the last week has upgraded me from 4MB/400KB Cable broadband, to 10MB/500KB - they still have an unlimited bandwidth policy too!

So what's required then? I'll start in order of what you see as a visitor:

  1. Domain registration - to get yourself a name on the 'net
  2. DNS - to point your domain to an IP address
  3. Dynamic DNS - to update your DNS with your dynamic IP address
  4. Firewall/Router - to block and route traffic around your LAN
  5. Web server (IIS 6.0) - to serve web pages
  6. Mail server (POP3/SMTP) - to send and receive email
  7. PHP/ASP - to server dynamic web pages
  8. MySQL - to provide database(s)
The following domains are currently hosted on the web server: With more to follow. [domain no longer active] is provided by DynDNS and the remaining domains have their DNS controlled by ZoneEdit.com

Let me know if you encounter any issues with the new hosting, as I've moved ~500MB from the Linux server across to the Windows server and have most likely missed something from my testing! If anyone is interested in having a site hosted on the new server, then get in touch - as a ZoneEdit account, along with a Domain of your choice is all you'll need. Uptime is currently 39 days and counting...

comments Posted: Monday 31st March 2008, 17:53pm
Categories: Articles, Computers and Technology, Slickhouse, Web
Tags: asp, dynamic-dns, ftp, hosting, merak, mysql, perl, php, virtual-server, web-server