How to secure your wordpress site - Eropus Technologies

How to secure your WordPress Site

There’s many strategies that you can secure your wordpress website. But, here one solution which solve lots of problem. So, the main target for hackers is your Database which we have to . Apply this before or after the wordpress setup. I recommend apply it during wordpress installation.


Step 1: Backup Your Database

Before making any changes, it’s important to take a back up your database. You can do this using phpMyAdmin or a plugin like All in one migration.

Step 2: Rename the Tables

You can use the following SQL queries to rename all the tables from wp_ to yourprefix_:

RENAME TABLE `wp_commentmeta` TO `yourprefix_commentmeta`;

RENAME TABLE `wp_comments` TO `yourprefix_comments`;

RENAME TABLE `wp_links` TO `yourprefix_links`;

RENAME TABLE `wp_options` TO `yourprefix_options`;

RENAME TABLE `wp_postmeta` TO `yourprefix_postmeta`;

RENAME TABLE `wp_posts` TO `yourprefix_posts`;

RENAME TABLE `wp_terms` TO `yourprefix_terms`;

RENAME TABLE `wp_termmeta` TO `yourprefix_termmeta`;

RENAME TABLE `wp_term_relationships` TO `yourprefix_term_relationships`;

RENAME TABLE `wp_term_taxonomy` TO `yourprefix_term_taxonomy`;

RENAME TABLE `wp_usermeta` TO `yourprefix_usermeta`;

RENAME TABLE `wp_users` TO `yourprefix_users`;


Step 3: Update the Options Table

The options table contains some entries that use the table prefix. Run the following query:

UPDATE `yourprefix_options` SET `option_name` = REPLACE(`option_name`, ‘wp_’, ‘yourprefix_’) WHERE `option_name` LIKE ‘wp_%’;


Step 4: Update the Usermeta Table

Similarly, the usermeta table also has entries that use the table prefix. Run the following query:

UPDATE `yourprefix_usermeta` SET `meta_key` = REPLACE(`meta_key`, ‘wp_’, ‘yourprefix_’) WHERE `meta_key` LIKE ‘wp_%’;


Step 5: Update wp-config.php

Finally, you need to update the table prefix in your wp-config.php file. Open the directory /public_html/wp-config.php and file the line:

$table_prefix = ‘wp_’;

Change it to:

$table_prefix = ‘yourprefix_’;


Step 6: Verify Changes

  1. Log in to your WordPress admin panel.
  2. Check that everything is working correctly and that there are no missing tables or data.

By following these steps, you will have successfully changed and secure your wordpress site.

Similar Posts

Leave a Reply

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