How To Change The Default WP Prefix of WordPress

Whenever a begginer install WordPress or allows his/her webhost to install WordPress, most likely they will choose not to change the default WP Prefix during the installation. This could lead to a serious security issue. Since, hackers like to exploit vulnerable installations of WordPress.

By default WP Prefix of WordPress is WP_ which allows attacker to use SQL injection attacks. Hence it is really important to change your default prefix to improve your website security.

How to change your Default Prefix While Installing WordPress

You can change your prefix while installing WordPress (depending on the way you are installing your WordPress) or you can choose to change your Wp Config File when the installation will be completed.


To change your Default Prefix edit the code highlighted in the image for ex you can cahnge Wp_ to RMWp_ or anything you wish for.

How to manually change prefix after Insatallation

If you have already installed and Have content and running plugins on your Website then using above method can give you Database error resulting into downtime of your Website.

Step By Step guide to Change Default Prefix

  • First create a Full Backup Of your Website.
  • Change the Deafult prefix in your Wp-config file as shown in above image.
  • You have to Edit your Core WordPress File one by one using phpMyAdmin. Replace default Wp_ with the prefix you want to use.


By default WordPress have 11 tables in database structure but you can see more tables since some plugins create database structure using default prefix.

Edit WP_Options Table Prefixes

You also need to look for Options tables and replace them with your default wp_prefix with your own prefix.

To change WP_Options Table Prefixes use this query

SELECT * FROM `yourownprefix_options` WHERE `option_name` LIKE ‘wp_%’

Edit User Meta Table Prefixes

To change your Meta Table Prefixes use this Query

SELECT * FROM `yourownprefix_usermeta` WHERE `meta_key` LIKE ‘wp_%’

How to change Wp_ prefix using plugins

  • Better WP Security
  • WP Prefix Changer
  • Change DB Prefix

Note – Please make sure that you haven’t created an .htaccess rule which will collide with the settings of this plugin. A clash between settings could lead to a Website Downtime.

To learn more Security measures go through our WordPress Security tutorial

Want To share Something With Us? Add it in our Comment Section.