{"id":10636172,"date":"2018-08-29T12:50:33","date_gmt":"2018-08-29T12:50:33","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/cannot-edit-delete-terms\/"},"modified":"2018-08-29T12:50:33","modified_gmt":"2018-08-29T12:50:33","slug":"cannot-edit-delete-terms","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/cannot-edit-delete-terms\/","title":{"rendered":"Cannot edit\/delete terms"},"content":{"rendered":"<p>A user has a subsite and she cannot delete or edit her tags\/cats. She is one of the admins of that site.  When she tries, she gets the following error:<\/p>\n<p>&#8220;You need a higher level of permission.<\/p>\n<p>Sorry, you are not allowed to edit this item.&#8221;<\/p>\n<p>I&#8217;m a super admin on this WordPress multisite installation, and I get the same error. I&#8217;ve done some research, and I don&#8217;t know if I found a bug or not. Let me explain what I&#8217;ve done via an example.<\/p>\n<p>I want to delete the category named China.  I went to the dashboard, Posts-&gt;Categories, and clicked delete. Received the error above.<\/p>\n<p>In the database:<\/p>\n<pre><code>select count(*) from wp_X_terms;\n+----------+\n| count(*) |\n+----------+\n|      234 |\n+----------+\n1 row in set (0.13 sec)<\/code><\/pre>\n<pre><code>select * from wp_X_terms where name = &#039;china&#039;;\n+---------+-------+-------+------------+\n| term_id | name  | slug  | term_group |\n+---------+-------+-------+------------+\n|      39 | China | china |          0 |\n+---------+-------+-------+------------+\n1 row in set (0.13 sec)<\/code><\/pre>\n<pre><code>select * from wp_X_term_taxonomy where term_id = 39;\n+------------------+---------+----------+-------------+--------+-------+\n| term_taxonomy_id | term_id | taxonomy | description | parent | count |\n+------------------+---------+----------+-------------+--------+-------+\n|              962 |      39 | category |             | 118398 |    10 |\n|             1112 |      39 | post_tag |             |      0 |     8 |\n+------------------+---------+----------+-------------+--------+-------+\n2 rows in set (0.13 sec)<\/code><\/pre>\n<p>We noticed that if a term had more than one entry in the wp_X_term_taxonomy category, it could not be edited via the UI.<\/p>\n<pre><code>select t.name, tt.taxonomy, count(*) from wp_X_terms t inner join wp_X_term_taxonomy tt on t.term_id = tt.term_id group by tt.term_id having count(*) &gt; 1;\n+----------------+----------+----------+\n| name           | taxonomy | count(*) |\n+----------------+----------+----------+\n| China          | category |        2 |\n| Exercise       | category |        2 |\n| Product Line   | category |        3 |\n| Popular Topics | category |        2 |\n+----------------+----------+----------+<\/code><\/pre>\n<p>(There were quite a few more results, but I truncated for brevity.)<\/p>\n<p>Am I missing something, or is this a bug in WordPress?<\/p>\n","protected":false},"template":"","class_list":["post-10636172","topic","type-topic","status-publish","hentry","topic-tag-categories","topic-tag-taxonomy","topic-tag-terms"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10636172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10636172\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10636172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}