How will you look on the security by changing the WordPress database prefix?

How will you look on the security by changing the WordPress database prefix?

Well said! One of the most recommended content management systems is known as WordPress. It helps to store your images, themes, content, plugins and post in your database. To get more information about your website, the database is the best choice. It consists of whole information about the website and the database is assumed as the website storage for most of the WordPress users. Whenever you install WordPress, it is a must to add the prefix wp_ but some users would forget to add the prefix.

So, here comes the track for spammers and hackers who keep their eye on your website to hack the information. It is better to keep on changing the prefix of the database often to protect both the database and website. Prefixes are considered to be the default way for the database. Handling a database is a hectic method so, it’s better to take backup without fail before starting any backend or frontend process.

Let us start the process:

Step 1:
Take your login credentials and log in to the account of cPanel. Here, you need to work on the WordPress directory so, go to the file section and then choose “File Manager”.

Step 2: Open public_html and then choose wp-config.php. To make changes on the wp-config.php, click on the edit option by right-clicking on it.

Step 3: You will receive a pop window and so, tap on the button “edit”.

$table_prefix = 'test_';
In the above line, you can see the prefix as test_. You can use underscore, letter and number as a prefix.

Step 4: Once, if you change the prefix in the file wp-config.php then do changes also in the database too. Go to cPanel for accessing phpMyAdmin. By now, the control panel of phpMyAdmin will be opened in front of you.

Step 5: In the control panel of phpMyAdmin, tap on the tab “SQL” for opening the window “SQL query”. You can see 12 types of prefixes listed one by one.

It would take more time for you to change all those prefixes instead query helps you to change the entire prefix.
  • RENAME table`wp_commentmeta`TO`test_commentmeta`;
  • RENAME table`wp_comments`TO`test_comments`;
  • RENAME table`wp_links`TO`test_links`;
  • RENAME table`wp_options`TO`test_options`;
  • RENAME table`wp_postmeta`TO`test_postmeta`;
  • RENAME table`wp_posts`TO`test_posts`;
  • RENAME table`wp_terms`TO`test_terms`;
  • RENAME table`wp_termmeta`TO`test_termmeta`;
  • RENAME table`wp_term_relationships`TO`test_term_relationships`;
  • RENAME table`wp_term_taxonomy`TO`test_term_taxonomy`;
  • RENAME table`wp_usermeta`TO`test_usermeta`;
  • RENAME table`wp_users`TO`test_users`;
Step 6: If you still find some tables have another prefix then use the query to change it. Start testing your page, dashboard, and image in WordPress.

If anything goes wrong you can use a backup of the database to implement old storage. Your database is secured now! I Hope, you are happy now!
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma