•2 min read•Wordpress•

How to rename WordPress tables prefix?

Replacing table prefix

Renaming the default WordPress tables prefix is one of the very important step to secure your WordPress from hacker.

There are two methods  to alter or rename WordPress tables prefix:

First Method :- To replace, rename or alter table prefix via Phpmyadmin Application table structure options.

1. Access your phypmyadmin
2. Select your database
3. In table structure check all tables from bottom as shown in screenshot 1.1
4. And choose replace table prefix option
5. To replace default WP_ prefix: Type wp in From input box and To input box type your preferred prefix for example ra_ and submit

Replacing table prefix
Replacing table prefix

Now you have successfully replaced default WordPress table prefix wp_ to your preferred table prefix.

Second Method :- To replace, rename or alter table prefix via Phpmyadmin sql commands.

Similarly if you wish you can run sql command to replace table prefix of a WordPress installation.

Syntax to replace table prefix

ALTER TABLE `fromprefix_table_name` RENAME `toprefix_table_name`;

 Example to replace a table prefix

ALTER TABLE `wp_links` RENAME `wp_links`;

Like above you have to execute the above mentioned syntax for each tables of your WordPress database.To run a sql command in phpmyadmin click on sql option from top option, write your sql code in sql   and to execute it click on go button  as shown in figure 1.2.

Figure 1.2: Phpmyadmin run sql command
Figure 1.2: Phpmyadmin run sql command

In each syntax write from prefix table name and to prefix table name correctly. Please note prefix always end with an underscore so don’t forget to put underscore between prefix and actual table name.

About the Author

Durgesh Gupta

Author

Content Writer at WebAnaya

Published: January 11, 2014Updated: November 12, 2026

Related Posts

Top 10 Themeforest WordPress News and Magazine Themes
In this post I am going to share you the Top 10 Themeforest WordPress themes which you may like to kick start your online News or Magazine website. Every theme consists the key WordPress theme components like variety of post layouts box, full width, supported by drag and drop editor plugins, elegant and modern looks, […]
Read article
Most popular free WordPress plugins
January 29, 2015•Durgesh Gupta•Wordpress

Most popular free WordPress plugins

Free and most popular WordPress plugins, which offers a wide range of useful features and functionality to keep your WordPress intact. Today I am going to share with you the most popular free WordPress plugins. Contact Form 7 – This is almost a mandatory plugin which require by almost every WordPress user, this free plugin […]
Read article
Themeforest: The Law – Lawyer Legal Attorney Responsive WP Theme Review
This is one of the perfect WordPress theme for Lawyer and law associates. “The Law” has 8 types of homepage which covers wide variety of homepage showcase from simple one page home page to complex multi page it is designed to give you real feel of law profession. Included Plugins: The Law – Lawyer Legal Attorney Responsive […]
Read article