WordPress: You are editing the page that displays your latest posts

Your WordPress site no longer allows the addition of a new article or a new page, the addition of images in existing content? Each time you attempt one of these operations,Is WordPress notifying you that you are editing the page that displays your latest posts?

Summary 

  • Impossible to add a new post/page, why?
  • You are editing the page that displays your latest posts
  • Checking database tables

Impossible to add a new article/page, why?

This problem, which can have multiple causes, is a real headache for any owner of a WordPress site. It most commonly occurs after some changes to the site, such as restoring the database or transferring the site database from one host to another.

It then happens that, for one or more tables, some or even all of the elements of the ID field (Primary key) take a null value, 0. The tables concerned will then have lost the automatic increment property ” Auto_increment “, and the addition new items will be impossible.

You are editing the page that displays your latest articles

The trick I’m going to show you here is the one that solved the problem on one of my sites. I had changed host and moved the database of the site concerned. At first, since I couldn’t see new comments anymore, I thought only the comments table was affected.

In fact, at the level of the left bar of WordPress, on ”  Comments ” I could see a number, 15 for example, to mean that there are 15 new comments. However, going to the comments page, I didn’t see any new ones. They were just invisible.

See also  Discover 15 things to do after installing WordPress 6.0 [best settings]

It was after, wanting to add an article, that I realized that it was impossible for me to add new content (article or page) or to upload media (images) in existing articles. Currently all these problems are solved, after weeks of trying several solutions.

Before showing you how to hopefully solve this problem, you must:

  • Have access to your site’s MySQL database server;
  • Make sure to download and save your database locally , before any manipulation.

Checking database tables

Access your database server. If you use phpMyAdmin, go to the left bar of the interface and click on the name of your database. Your database tables will be displayed.

It is possible that the tables in your database have a prefix other than ”  wp _”. It can be for example ”  ab_  “, and in this case your table will be ”  ab_posts  “. In any case, the name of this table will end in “  _posts  ”. You will recognize it that way.

Database tables

Scroll between the tables, find and click on “  wp_posts  ”. Observe if, in the ID field, some values ​​are null. That is, if there are values ​​that are equal to 0. Still in the wp_posts table, click on the SQL tab .

Running SQL commands in phpMyAdmin

Delete the line below:

 SELECT * FROM `wp_posts` WHERE 1

Then run the following commands, making sure to replace “wp_” with your table prefix . You will get an error if you run wp_posts while your table is named ab_posts or xy_posts . Here are the commands to run:

DELETE FROM wp_posts  WHERE ID=0;

ALTER TABLE  wp_posts ADD PRIMARY KEY(ID);

ALTER TABLE wp_posts CHANGE ID ID  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
Added a new WordPress post

Run the commands and return to your site to see if you can add posts, pages, and media again. You can then close your database server and write new content on your site.

5/5 - (1 vote)
SAKHRI Mohamed
SAKHRI Mohamed

The blog of a computer enthusiast who shares news, tutorials, tips, online tools and software for Windows, macOS, Linux, Web designer and Video games.

Articles: 3757

Leave a Reply

Your email address will not be published.