Wordpress - Sorry, you are not allowed to edit this item

13,525

If you're trying to edit Categories/Custom taxonomies and you get this error, you should be doing the following.

  1. 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;
    
  2. Check for the taxonomy column in the wp_term_taxonomy table that you would like to retain and delete the other taxonomy record. Before deleting refer #3.

  3. You should also be deleting records from wp_term_relationships table for the corresponding term_taxonomy_id that you're deleting from the wp_term_taxonomy table.

Tip: Back up your database before executing any DELETE queries on your database.

Share:
13,525
Dragomir Ivanov
Author by

Dragomir Ivanov

Updated on June 08, 2022

Comments

  • Dragomir Ivanov
    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:

    1. I checked all the prefix stuff since my perfix isnt wp_ so everything is accurate in users_meta, also in wp_options.

    2. I even tried inserting new administration user with php code, I got the same error.

    3. 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 message

    Sorry, 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
      ItsOdi1 over 7 years
      Have you updated your SQL database with the new https url?
    • Dragomir Ivanov
      Dragomir Ivanov over 7 years
      Yes, i did. Every url in the database is with https.
    • ItsOdi1
      ItsOdi1 over 7 years
      When did you moved the website?
    • DACrosby
      DACrosby over 7 years
      What 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
      Nohl about 5 years
      I 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
    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
    Evan Nagle over 6 years
    This saved me some serious time, Maria. Thanks!
  • Daniel Setréus
    Daniel Setréus about 6 years
    This 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
    Sid James over 5 years
    Thank 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
    mukto90 over 4 years
    NEVER edit core files as you'll lose every change you made when you update WordPress to a newer version.
  • Arsalan Mithani
    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