Wordpress error
After installing a WordPress Blog I started installing some useful plugins. One of them was WP Security Scan. One of the errors in the initial scan was that I had the wp_ prefix in the tables of my database. So I followed the instructions and changed them. But after that, each time I use tried to log in, I get:
You do not have sufficient permissions to access this page.
I couldn’t enter the admin page, or any post, nothing was working. But after a few moments of documentation I found out that the meta_key in the usermeta table values were still tied down to:
- wp_user_level
- wp_capabilities
- wp_autosave_draft_ids
Of course I had to update it to my new prefix mynewprefix
- mynewprefix_user_level
- mynewprefix_capabilities
- mynewprefix_autosave_draft_ids
The SQL statement I used was:
UPDATE `mynewprefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘mynewprefix_’ );
(Make sure you do backups first! Note that the quotes used for string and field name are different, and replace mynewprefix with your own) In the options table, there is
Tags: admin, autosave, Blog, course, database, documentation, draft, error, field, level, meta, mynewprefix, name, nothing, option, page, post, REPLACE, Scan, Security, SET, SQL, statement, string, table, time, UPDATE, use, user, usermeta, WHERE, Wordpress

Leave a reply