How To: Update Your WordPress Database Name

Last week while I was doing some spring cleaning, I decided to move a few of my sites over to a new CPanel.   The move went fairly smoothly, but once everything was moved, there was the matter of updating the WordPress database to show the new database name. If you are wanting to do something similar, here is what you need to do.

All you need to do is update the wp-config.php file to point towards the new database name, which should be found in the root of your WordPress installation.   Open the wp-config.php file and look for the following code:

define('DB_NAME', 'dbname');

Where it says dbname, update the name of your database.  If your login name changed, you’ll want to update that as well.

Once that was done, the only problem I encountered was that I was unable to upload pictures.   The fix?  Go into your WordPress dashboard and go to Settings –> Miscellaneous and update the path where images are uploaded to.

  • Leave a Comment
  • Which Plugins Do You Want to See Built into WordPress?

    It seems like every time WordPress gets close to a new release, I praise the WordPress team for integrating popular WordPress plugins into the WordPress software and I get several of the same responses…”If it already exists a WordPress plugin, why waste time installing it into the software?”

    Unfortunately, just because a WordPress plugin exists, it doesn’t mean that we aren’t better off having it built into WordPress.  Here are a few reasons:

    • Security Vulnerabilities – Improperly coded WordPress plugins can cause security vulnerabilities. Now, this can obviously happen with the WordPress software, but it is more likely to be coded correctly or caught and fixed quickly when it is integrated into the WordPress software.
    • Wasting Database Resources – Poorly coded WordPress plugins can waste a lot of database resources. Unneeded database queries can cause slow loading times, etc.
    • Everyone Has Access – Although we all know about WordPress plugins, I’m sure there are a number of users who don’t understand what they are, how they work, how to install them, etc.  Having it built into WordPress ensures that everyone has access to these features.

    It is with this thought process that I always try to use as few WordPress plugins as possible on my websites, and I rejoice every time popular WordPress plugins are built directly into WordPress.

    With WordPress 2.7 coming out soon, we’ll be getting a bunch of new plugins built into WordPress.  What plugins would you like to see built into WordPress next?  Keep in mind that the plugin would need to be something that would benefit most (if not all) WordPress users in order to be considered (not situational plugins).

    The five I would like to see built into WordPress next:

    1. All-in-One SEO Pack (or at least some parts of it) – This is very basic stuff and everyone who uses WordPress would benefit.
    2. Google XML Sitemaps – This is one of the most popular WordPress plugins and for good reason. A sitemap.xml file should come standard with any blogging software.
    3. No Self Pings – Why does WordPress send pingbacks internally?  I think this one would be easy to integrate and people would love it.
    4. Popularity Contest – We have recent posts, recent comments, etc.  Who wouldn’t want this as an option on their WordPress theme?
    5. Database Manager – It would be nice if there was a way that you could easily backup and restore your database without the use of a WordPress plugin.

    Share your five most wanted in the comments!

  • Leave a Comment
  • How To: Moving WordPress to Another Server

    Yesterday I wrote a post explaining how to move your WordPress install within your website/server.  Today I wanted to cover how to move your WordPress install to a completely different server.

    Again, the flexibility of WordPress shines, making this not overly difficult to accomplish.  If you aren’t changing your domain name, all you need to do is update your wp-config.php file and upload all of your files to their new server.

    If you are changing your domain name with your move, here is the information you’ll need:

    1. Backup your WordPress database.
    2. Download the complete WordPress install to your hard drive and identify the folder as your OLD installation.
    3. Login into your old blogs dashboard and update the Settings to reflect the website and blogs new location (both fields should be the same).
    4. Now, download the complete WordPress install to your hard drive, but this time identify the folder as your NEW installation.  This will include the settings change you just made.
    5. Download a copy of your WordPress database (keeping the old one) and then upload it to the new server.  You’ll want to keep the same database name and recreate the user login information (you can use your same user name and password).  If you change the database name, you’ll need to update your wp-config.php file to reflect the change.
    6. Upload your NEW installation folder so that your blog is now working in its new location!

    If you want to keep your old blog, you’ll need to upload the OLD folder to the OLD location of your blog and readjust the General Settings tab.

    Another way to accomplish all of this is to simply make a fresh WordPress install and export/import your posts to the new location.   This isn’t the most ideal method, but it is much easier and will get the job done.

    For additional information, you’ll want to consult the WordPress Codex.

  • Leave a Comment
  • How To: Change the WordPress Author Archive Permalink

    Say you have an author page on your WordPress blog; but what happens when you find that your author archive URL looks like this?

    Of course, you’d probably want to change your name to a more “URL-friendly” format like this:

    How do you do it?

    Well, WordPress itself doesn’t let you (probably because the URL is intended to be a permalink), but it can still be accomplished through a simple database modification.

    Here’s how. This is assuming your hosting account is setup with phpMyAdmin. (If you don’t have database editing experience, you might want to make a database backup just in case.)

    1. Go to your hosting account’s cPanel and click on the “phpMyAdmin” icon. If you don’t see it, look for a “MySQL Databases” icon, click it, scroll down to the bottom of the page, and then click the phpMyAdmin link.
    2. Select your WordPress database from the menu on the left.
    3. Select the wp_users table, and then click the “Browse” tab.
    4. Locate the row that has your username in the user_login column. Click the Edit button (the pencil icon) on that row.
    5. Enter the desired URL version of your name into the user_nicename field.
    6. Click “Go” to save your changes.

    And that’s it! Your author archive will now show up at your new URL.

  • Leave a Comment