Can’t publish new posts

I have been working with a client to migrate a site to a new host provider. I migrated the db manually, and have run into an issue that I have never seen before. I can edit ALL existing posts, but when I try to create a new post – in the Permalink field, under “Enter title here” I see:
Permalink: ?preview=true

enter image description here

When I publish or save the draft, I receive: Sorry, you are not allowed to edit this post.

enter image description here

Also, on the posts, there is no preview button.

Steps taken in order to try to fix:

  1. I have turned on WP_debug, which was little help for this issue.

  2. I switched my theme to 2017 to see if there were theme conflicts occurring, no help.

  3. I disabled all plugins after switching the theme, no help.

  4. I compared my wp_capablities row in wp_usermeta to other existing wp_capabilities row;

  5. I did try a sql statement to replace the admin cap, i.e.:

UPDATE wp_usermeta
SET meta_value = REPLACE( meta_value, ‘a:1:{s:13:\”administrator\”;s:1:\”1\”‘,’a:1:{s:13:\”administrator\”;b:1’ );

So now my admin cap is set to: a:1:{s:13:\”administrator\”;b:1′ )

But I am still receiving the same results.

I was hoping someone might recognize this error and be able to point out where I screwed up.

Thx!
Chipleh

2 Answers
2

There are, still, references to old domain in your database, which have to be fixed.

Step 1: go to Settings -> Permalinks and click on Save Changes button. This will fix your permalinks.

Step 2: install and activate Better Search Replace plugin. Go to Tools -> Better Search Replace. Replace the old domain ( example.com ) to the new one ( whatever.net ) in all tables.

You can skip Step 2, if the domain name didn’t change.

Make sure that admin cap is exactly a:1:{s:13:"administrator";b:1;}.

Leave a Comment