Technology Insights

Change the Table Prefix of WordPress Blog MySQL Database from wp_

The directions below will provide simple instructions on changing the prefix to your WordPress blog’s MySQL database from wp_ to whatever you choose. Its a good idea to change this prefix to prevent zero-day SQL injection attacks from being performed against your WordPress installation since your database tables will be known to everyone if you use the default prefix. So follow the below directions to make the change that should only cause minimal downtime if the steps are followed properly.

  1. MySQL Database Backup:Use the CLI or backup your database from phpMyAdmin. If using phpMyAdmin use the export feature to export a SQL version of your database and download it to the PC you are working on. Your backup should be something similar to mydb_DATE.sql.

Technology Insights

Remove the Website Field For Comment Posting on WordPress Using Mandingo Theme

In an attempt to promote as much community as possible I would suggest removing the Website field for when people post comments to your WordPress blog. In this scenario below the Mandingo Theme is being used however it is just as easy to remove the Website field from the default field as well. If people still want to post their web site when making a comment they can do so in the body of the comment.

If you are using the Mandingo Theme then you will need to modify two files but if using the default WordPress Theme you should only need to modify one file. The lines to remove should be the same or very similar no matter what Theme you are using.

In Mandingo follow the below directions to remove the Website field from the comments form when people are not logged in.

Technology Errors

The WP Block Admin WordPress Plugin Not Working After Upgrade From 1.0 to 1.2

Recently I was upgrading various WordPress plugins one of which was the WP Block Admin plugin. This plugin will redirect all users with certain permissions away from the default /wp-admin directory back to the homepage after login. This is beneficial if most of your users only have to login for a forum or for comments on WP posts. After upgrading the plugin I noticed it was no longer working. I went through the below steps to resolve the problem.

First off the configuration file for this plugin is very simple thus making it an easy problem to resolve. The plugin is located in the /wp-content/plugins/ sub directory in a folder called wp-block-admin and besides a readme file there is only one PHP file located in this directory called wp-block-admin.php. Besides the commenting (including version number) at the top of the file the only other difference in the file was on line 33.

Technology Insights

WordPress Plugin: QuickCode Quick Reference Information

I typically post a lot of code or Linux shell data into WordPress posts using the SyntaxHighlighter plugin however in some scenarios that doesn’t always work the best so I use the QuickCode plugin. Since QuickCode is only rarely used I always forget the possible options that are available so this is a quick reference to those options.

QuickCode: A WordPress plugin formater

Standard QuickCode Post With No Options:
[quickcode]
<?php print “This is sample code line one”; ?>
<?php print “This is sample code line two”; ?>
<?php print “This is sample code line three, Question Defense ROCKS!”; ?>
[/quickcode]

Technology Insights

How to Use Gmail as an SMTP Server

Below is a brief explanation of how to use Gmail as an SMTP server to send email. I personally needed to configure Gmail to test Cforms WordPress plugin to make sure there wasn’t a problem with a clients hosting company servers native PHP mail. I used the below steps to create an account, configure the Gmail settings, and then verify the email was sent.

  1. Create Gmail Account: Got to gmail.com and create a new account.
  2. Open Cform Settings: Login to your WordPress admin, click on cforms in the left side nav, click on “Global Settings”, and then click on the “SMTP Server Settings” line.