---
title: "Change WordPress Database Table Prefix Back To wp_ – Akash Joshi"
description: "Here is how to change the WordPress database tables back to the default wp_ prefix. First thing is to change the php constant table prefix in wp-config.php Change the wp-config.php constant…"
language: "en-US"
canonical_url: "https://hge15n7lqpngjq6.onstatic.studio/change-wordpress-database-table-prefix-back-to-wp_/"
source_url: "https://hge15n7lqpngjq6.onstatic.studio/change-wordpress-database-table-prefix-back-to-wp_/"
content_type: "text/markdown"
---

Wordpress
                2 min read
        · August 29, 2022




# Change WordPress Database Table Prefix Back To wp_



        A

          admin
          writing from Ahmedabad





              ![Change WordPress Database Table Prefix Back To wp_](https://hge15n7lqpngjq6.onstatic.studio/wp-content/uploads/2022/12/WordPress-table-prefix.jpg)










      — Reading
      0%













Here is how to change the WordPress database tables back to the default wp_ prefix.

First thing is to change the php constant table prefix in *wp-config.php*

### Change the wp-config.php constant

```
$table_prefix = 'wp_';
```

### Change the table prefixes in phpMyAdmin

![](https://hge15n7lqpngjq6.onstatic.studio/wp-content/uploads/2022/08/change-wordpress-database-prefix-300x264.png)Select all WordPress Database Tables

Next open your WordPress database in phpMyadmin, select all the tables and choose the option to *‘Replace table prefix’* then in the resulting dialog box put in the *from* and *to* prefixes.

### Replace Other Prefix References in the Database

There are also some other references in the tables that need to be changed in the *options* and *usermeta* tables.

Keeping our example – *changing weirdprefix_ back to wp_* in the phpMyadmin SQL tab run this sql command.

![](https://hge15n7lqpngjq6.onstatic.studio/wp-content/uploads/2022/08/change-wordpress-database-prefix-sql-command-300x95.png)SQL command to change other reference prefixes

```
update wp_usermeta set meta_key = 'wp_capabilities' where meta_key = 'weirdprefix_capabilities';
update wp_usermeta set meta_key = 'wp_user_level' where meta_key = 'weirdprefix_user_level';
update wp_usermeta set meta_key = 'wp_autosave_draft_ids' where meta_key = 'weirdprefix_autosave_draft_ids';
update wp_options set option_name = 'wp_user_roles' where option_name = 'weirdprefix_user_roles';

```

That’s it all done – back to the original prefix of wp_

*( I realise some like to change it to add an extra security layer)*

Source: [WPBeaches](https://wpbeaches.com/change-wordpress-database-table-prefix-back-to-wp_/)










      AJ

        — written by
        Akash *Joshi*


Solo project manager and builder, currently shipping from Ahmedabad. Writes one short field note a month from inside client work — usually after breaking something.



          [
            More about Akash → →
          ](https://calendly.com/akash-whitelabelai/30min)








## Keep *reading*

      [
        All notes →
      ](https://hge15n7lqpngjq6.onstatic.studio/notes/)


              [


            E


                          Wordpress
                        2 min
            · Oct 15



### Exploring the Freshest Trends in Website Design and Development – September 2023

        ](https://hge15n7lqpngjq6.onstatic.studio/exploring-the-freshest-trends-in-website-design-and-development-september-2023/)
              [


            W


                          Wordpress
                        3 min
            · Jul 9



### WordPress Themes vs. Custom Designs: Making the Right Choice for Your Website

        ](https://hge15n7lqpngjq6.onstatic.studio/wordpress-themes-vs-custom-designs/)
              [


            U


                          Wordpress
                        2 min
            · Jul 6



### Unleashing the Power of AI🤖: Enhancing Customer Support on WordPress Websites

        ](https://hge15n7lqpngjq6.onstatic.studio/unleashing-the-power-of-ai%F0%9F%A4%96-enhancing-customer-support-on-wordpress-websites/)









### Field notes, *monthly.*





One short email a month with the most useful thing I learned. No fluff. Unsubscribe in one click.

                      **~310 subscribers**.
