WPTemplate.com

How to Change Your WordPress Database

The Database is essentially the brain for your website since all your information is stored in it. Changing your Database prefix is the first step to securing your website against hackers.

A warning before we get on to securing your website, backup your Database. You could use the BackupBuddy plugin to do so. Next make sure you direct visitors to the temporary maintenance page while you go on to make these changes at lightning speed.

Change Your WordPress Database

Open you wp-config.php file in the root directory and change the table prefix from wp_ to something else like wp_s1e2c3u4r5e6. It does not matter what the contents of the string are, as long as it is different. Next is to change the database table names. There are 11 tables which WordPress creates, which are found in the SQL tab under the phpMyAdmin in the cPanel. Copy the command below to rename all your tables and change the mn8cvp82d933pxq to your own string.

RENAME table `wp_commentmeta` TO `mn8cvp82d933pxq_commentmeta`;

RENAME table `wp_comments` TO `mn8cvp82d933pxq_comments`;

RENAME table `wp_links` TO `mn8cvp82d933pxq_links`;

RENAME table `wp_options` TO `mn8cvp82d933pxq_options`;

RENAME table `wp_postmeta` TO `mn8cvp82d933pxq_postmeta`;

RENAME table `wp_posts` TO `mn8cvp82d933pxq_posts`;

RENAME table `wp_terms` TO `mn8cvp82d933pxq_terms`;

RENAME table `wp_term_relationships` TO `mn8cvp82d933pxq_term_relationships`;

RENAME table `wp_term_taxonomy` TO `mn8cvp82d933pxq_term_taxonomy`;

RENAME table `wp_usermeta` TO `mn8cvp82d933pxq_usermeta`;

RENAME table `wp_users` TO `mn8cvp82d933pxq_users`;

Click go once you are done and your table has been renamed. You will need to change the name of the tables in any other fields that they may appear go. A simple search query is as under:

SELECT * FROM `mn8cvp82d933pxq_usermeta` WHERE `meta_key` LIKE \'%wp_%\'

Now change the meta_key in every result with the wp string that you entered. With this your site should be a lot harder to hack into!

Leave a Reply

Your email address will not be published. Required fields are marked *

sixteen − eight =

Time limit is exhausted. Please reload the CAPTCHA.

1000's of Wordpress Templates at Great Prices: Visit ThemeForest