Wordpress - Sorry, you are not allowed to edit this item
If you're trying to edit Categories/Custom taxonomies and you get this error, you should be doing the following.
Check the
wp_term_taxonomy
table for Term IDs that are associated with more than one Taxonomy ID. These records are the root cause for the error. The following query should help you find that.SELECT term_id, COUNT(term_id) FROM wp_term_taxonomy GROUP BY term_id HAVING COUNT(term_id) > 1;
Check for the
taxonomy
column in thewp_term_taxonomy
table that you would like to retain and delete the othertaxonomy
record. Before deleting refer #3.You should also be deleting records from
wp_term_relationships
table for the correspondingterm_taxonomy_id
that you're deleting from thewp_term_taxonomy
table.
Tip: Back up your database before executing any DELETE queries on your database.
Dragomir Ivanov
Updated on June 08, 2022Comments
-
Dragomir Ivanov almost 2 years
I've got weird error message on one of my site after moving to a new hosting
Sorry, you are not allowed to edit this item.
What I found as solutions and didn't work for me is:
I checked all the prefix stuff since my perfix isnt
wp_
so everything is accurate inusers_meta
, also inwp_options
.I even tried inserting new administration user with php code, I got the same error.
I also tried deactivating all the plugins & resetting to default theme but nothing worked.
The server i'm moved on to has ssl, so its https conenction which is covered with updates of all urls inside db.
Another issue is when i logged in
wp-admin
it shows same messageSorry, you are not allowed to edit this item.
In the front-end I see the fully functional wp-bar with all buttons edit page/Create New post/page/etc. But when I click it shows same error as above.
Any suggestions?
-
ItsOdi1 over 7 yearsHave you updated your SQL database with the new
https
url? -
Dragomir Ivanov over 7 yearsYes, i did. Every url in the database is with https.
-
ItsOdi1 over 7 yearsWhen did you moved the website?
-
DACrosby over 7 yearsWhat exactly are you trying to do? Are you trying to edit a Page/Post, or do you get the error before you even see the WP Dashboard? Sounds like the error on the front-end as well, does the site itself work or do you only see the error?
-
Nohl about 5 yearsI had a site with this error. Turned out nearly every table had the Auto-Increment flag turned off and many were missing the Primary Key flag as well. I also found duplicate data in the Primary Key column. I fixed the tables manually using MyPHP Admin. I've seen SQL queries that should work more efficently.
-
Maria Daniel Deepak almost 7 years@Dragomir Ivanov, @Arsalan Mithani Adding the following line -
if (is_admin()) return true;
could potentially lead to security leaks. -
Evan Nagle over 6 yearsThis saved me some serious time, Maria. Thanks!
-
Daniel Setréus about 6 yearsThis is a very bad solution. Aside from editing core it removes all capability-checks - and there will be no difference between the user roles.
-
Sid James over 5 yearsThank you Mathani, you were the only writer on the internet who actually explained where the security check was taking place. This allowed me to temporarily suspend the check to fix a corrupt administrator profile. I used 'return true;' to effectively suspend the function and allow dashboard access, Turned it back on afterwards, naturally.
-
mukto90 over 4 yearsNEVER edit core files as you'll lose every change you made when you update WordPress to a newer version.
-
Arsalan Mithani over 4 years@mukto90 it is clearly stated in the end already what you said in your comment. It only shows where the check is taking place. Let me highlight it