最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - New PagePost Screen Opens an Existing Post

programmeradmin0浏览0评论

When I go to add a post or page to my WordPress site, the permalink and featured image are already populated with a 10 year old post, thus we are unable to create new content.

Recent changes done on the site:

  • We ran a find-and-replace in wp_posts to rebrand part of our company, however that should only have affected that string inside <p> tags since our search included spaces
  • We deleted old post revisions from the database to make it lighter
  • We ran a database cleanup plugin

I know one solution will be to rollback the database before these changes were made, but this bug was only discovered now (a week later), so recovering from the error is preferable.

When I go to add a post or page to my WordPress site, the permalink and featured image are already populated with a 10 year old post, thus we are unable to create new content.

Recent changes done on the site:

  • We ran a find-and-replace in wp_posts to rebrand part of our company, however that should only have affected that string inside <p> tags since our search included spaces
  • We deleted old post revisions from the database to make it lighter
  • We ran a database cleanup plugin

I know one solution will be to rollback the database before these changes were made, but this bug was only discovered now (a week later), so recovering from the error is preferable.

Share Improve this question asked Feb 4, 2020 at 23:42 Coulter PetersonCoulter Peterson 12 bronze badges 1
  • Whats the URL in the address bar? Does it match the URL of the add new button? Are you using the Block editor? Classic editor? A page builder plugin? Have you disabled all plugins then re-enabled them one by one to identify the culprit? Any info you can add to your question would be helpful – Tom J Nowell Commented Feb 5, 2020 at 0:10
Add a comment  | 

1 Answer 1

Reset to default 0

Turns out that a previously-modified line in the Yoast SEO source code had been reverted, so this error came back in debug.log: 1Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given.

Disabling Yoast resolved the New Page/Post error, however I believe the root cause was that the database has been around for a few versions of WordPress and needs to be rebuilt soon for better stability (just like re-installing Windows after a couple years).

EDIT: So the root cause was that at some point wp_posts lost its primary key and had auto-increment disabled on ID, so new DB entries were all getting an ID of 0. Then, when we tried to restore the backup of that database snapshot, we received import errors because of the duplicate ID entries, causing an incomplete database restore. Once we removed the extra ID 0 entries we were able to properly import our database backup and get the site to its former glory.

发布评论

评论列表(0)

  1. 暂无评论