1

When I logged in on my site this morning I noticed that my user can’t publish anything. I am administrator and the only user on the site.

On Posts and Pages instead of “Publish” I have the “Submit for review” button and if I click on it the page is blank and displays “Sorry you are not allowed to modify this post”.

I have the same issue with all my plugins disabled and even after cache reset.

Can you help me?

Edit: Thanks for the answers i finally managed to fix everything

I found the answer ! After wandering on the Internets I found this page : https://wpindexfixer.tools.managedwphosting.nl/wpindexfixer/

So here is what I gave SQL:

    DELETE FROM wp_users WHERE ID = 0;
ALTER TABLE wp_users ADD PRIMARY KEY  (ID);
ALTER TABLE wp_users ADD KEY user_login_key (user_login);
ALTER TABLE wp_users ADD KEY user_nicename (user_nicename);
ALTER TABLE wp_users ADD KEY user_email (user_email);
ALTER TABLE wp_users MODIFY ID bigint(20) unsigned NOT NULL auto_increment;

DELETE FROM wp_usermeta WHERE umeta_id = 0;
ALTER TABLE wp_usermeta ADD PRIMARY KEY  (umeta_id);
ALTER TABLE wp_usermeta ADD KEY user_id (user_id);
ALTER TABLE wp_usermeta ADD KEY meta_key (meta_key(191));
ALTER TABLE wp_usermeta MODIFY umeta_id bigint(20) unsigned NOT NULL auto_increment;

DELETE FROM wp_posts WHERE ID = 0;
ALTER TABLE wp_posts ADD PRIMARY KEY  (ID);
ALTER TABLE wp_posts ADD KEY post_name (post_name(191));
ALTER TABLE wp_posts ADD KEY type_status_date (post_type,post_status,post_date,ID);
ALTER TABLE wp_posts ADD KEY post_parent (post_parent);
ALTER TABLE wp_posts ADD KEY post_author (post_author);
ALTER TABLE wp_posts MODIFY ID bigint(20) unsigned NOT NULL auto_increment;

DELETE FROM wp_comments WHERE comment_ID = 0;
ALTER TABLE wp_comments ADD PRIMARY KEY  (comment_ID);
ALTER TABLE wp_comments ADD KEY comment_post_ID (comment_post_ID);
ALTER TABLE wp_comments ADD KEY comment_approved_date_gmt (comment_approved,comment_date_gmt);
ALTER TABLE wp_comments ADD KEY comment_date_gmt (comment_date_gmt);
ALTER TABLE wp_comments ADD KEY comment_parent (comment_parent);
ALTER TABLE wp_comments ADD KEY comment_author_email (comment_author_email(10));
ALTER TABLE wp_comments MODIFY comment_ID bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_links WHERE link_id = 0;
ALTER TABLE wp_links ADD PRIMARY KEY  (link_id);
ALTER TABLE wp_links ADD KEY link_visible (link_visible);
ALTER TABLE wp_links MODIFY link_id bigint(20) unsigned NOT NULL auto_increment;

DELETE FROM wp_options WHERE option_id = 0;
ALTER TABLE wp_options ADD PRIMARY KEY  (option_id);
ALTER TABLE wp_options ADD UNIQUE KEY option_name (option_name);
ALTER TABLE wp_options MODIFY option_id bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_postmeta WHERE meta_id = 0;
ALTER TABLE wp_postmeta ADD PRIMARY KEY  (meta_id);
ALTER TABLE wp_postmeta ADD KEY post_id (post_id);
ALTER TABLE wp_postmeta ADD KEY meta_key (meta_key(191));
ALTER TABLE wp_postmeta MODIFY meta_id bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_terms WHERE term_id = 0;
ALTER TABLE wp_terms ADD PRIMARY KEY  (term_id);
ALTER TABLE wp_terms ADD KEY slug (slug(191));
ALTER TABLE wp_terms ADD KEY name (name(191));
ALTER TABLE wp_terms MODIFY term_id bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_term_taxonomy WHERE term_taxonomy_id = 0;
ALTER TABLE wp_term_taxonomy ADD PRIMARY KEY  (term_taxonomy_id);
ALTER TABLE wp_term_taxonomy ADD UNIQUE KEY term_id_taxonomy (term_id,taxonomy);
ALTER TABLE wp_term_taxonomy ADD KEY taxonomy (taxonomy);
ALTER TABLE wp_term_taxonomy MODIFY term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_term_relationships WHERE object_id = 0;
DELETE FROM wp_term_relationships WHERE term_taxonomy_id = 0;
ALTER TABLE wp_term_relationships ADD PRIMARY KEY  (object_id,term_taxonomy_id);
ALTER TABLE wp_term_relationships ADD KEY term_taxonomy_id (term_taxonomy_id);


DELETE FROM wp_termmeta WHERE meta_id = 0;
ALTER TABLE wp_termmeta ADD PRIMARY KEY  (meta_id);
ALTER TABLE wp_termmeta ADD KEY term_id (term_id);
ALTER TABLE wp_termmeta ADD KEY meta_key (meta_key(191));
ALTER TABLE wp_termmeta MODIFY meta_id bigint(20) unsigned NOT NULL auto_increment;


DELETE FROM wp_commentmeta WHERE meta_id = 0;
ALTER TABLE wp_commentmeta ADD PRIMARY KEY  (meta_id);
ALTER TABLE wp_commentmeta ADD KEY comment_id (comment_id);
ALTER TABLE wp_commentmeta ADD KEY meta_key (meta_key(191));
ALTER TABLE wp_commentmeta MODIFY meta_id bigint(20) unsigned NOT NULL auto_increment;

Despite an error on the primary key for table wp_usermeta this went well and everything is back to normal.

3
  • Have you checked the database to make sure you're still an admin?
    – WebElaine
    Commented Jul 31, 2018 at 13:27
  • You could try adding a user role management plugin to re-add missing capabilities, but it sounds like you may have been "demoted" somehow.
    – WebElaine
    Commented Jul 31, 2018 at 13:27
  • Hello @notarobot - Welcome to the WordPress Development community! Please refrain from answering your question within the question itself. If you have found a solution, post it as a separate answer. Elaborating on why your solution works will also improve it's quality. Check out the "How to Answer" page in our help center
    – bosco
    Commented Aug 2, 2018 at 15:08

4 Answers 4

0

Please do not use this (opening post) script as the scheme might have changed, use this https://wpindexfixer.tools.managedwphosting.nl/wpindexfixer/ up to date script

0

If you are certain, by checking the wp_users table in your database (phpmyadmin), that you are still an administrator, then backup your database and then repair the wp_users and wp_posts tables. If that doesn't fix it, then look at the 're-add auto increment' paragraph in this article...

http://serversideguy.com/2018/01/31/wordpress-admin-is-seeing-submit-for-review-instead-of-publish-how-do-i-fix-that/

(Replace wp_ with whatever your table prefix is if it's not wp_)

0

Install a role editor plugin and reset all permissions and capabilities.

Additionally, try to create a new admin user (if you can) and see if the problem persists when logged in as the new admin user.

Do you have a plugin which allows admins to review author/editor posts? If yes, that plugin might have messed up or corrupted some of the capabilities.

0

I had same problem, my problem was when I installed the SSL certificate. So I had to backup for without SSL.

When I restored, my admin user cannot publish posts, pages and upload imagens. It's a problem with auto increment.

This 2 lines SQL solved:

-- change YOURPREFIX_users for your database prefix.

DELETE FROM YOURPREFIX_users WHERE ID = 0;
ALTER TABLE YOURPREFIX_users MODIFY ID bigint(20) unsigned NOT NULL auto_increment;

My php version 5.6.35

WordPress version 5.6.1

1
  • You mean MySQL version 5.6?
    – Rup
    Commented Feb 13, 2021 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.