Rename table prefix in phpmyadmin if does not begin with wp_ but contains it

I would like to rename the prefix for WordPress database. I understand that the way to do this is to replace the wp_ prefix in the phpmyadmin tables.

The fields that begin with wp_ are easy to find and replace. Do I need to change fields that contain _wp_ within them? For example:

Read More

Do I need to replace the wp_ in the below?

dismissed_wp_pointers

or

_wp_attached_file_wp_pointers

.
EDIT

Notice that in addition to replacing “table” prefixes, I would also update “rows” within a table. For example, within the table wp_usermeta I must replace a few rows such as wp_capabilities
Within wp_usermeta table there is a row called

dismissed_wp_pointers

Am I suppose to replace the wp_ in there?

Related posts

Leave a Reply

3 comments

  1. You will need to update all database tables that begin with wp_ to use your new prefix. This prefix should be set in wp-config.php. You will also need to update all of the meta_key in the usermeta table and option_name in the options table fir values that contain your previous prefix to use the new one.

    Update PREFIX_options table option_name values

    SELECT * 
    FROM `PREFIX_options` 
    WHERE `option_name` LIKE '%wp_%'
    

    Update PREFIX_usermeta table meta_key values

    SELECT * 
    FROM `PREFIX_usermeta` 
    WHERE `meta_key` 
    LIKE '%wp_%'
    

    See one of my other answers for an example of why it is important to update these values (the $wpdb->prefix . "capabilities" key in this case).

  2. It seems that you should not change dismissed_update_core‘s name.

    After reading doublesharp’s comment, I made a search through the WordPress’s code and found that dismissed_update_core was hardcoded, unlike wp_user_level for instance. Prefixed names use $wpdb->get_blog_prefix() (which returns base_prefix for single blog WordPress sites) or $wpdb->prefix that you can lookup in the source code.

    You’ll find the hardcoded dismissed_update_core in wp-adminincludesajax-actions.php and wp-adminincludesclass-wp-internal-pointers.php.