Opened 11 months ago
Last modified 2 months ago
#62769 new enhancement
Saving Post without Title and Content
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Hi Team,
While saving the post, I found that the post is saving with the title and content and showing the success message as shown in the given screenshot.
By clicking into the View Post, it opens the 404 page, which is not correct either.
I would suggest adding some validation to check if the title should not be blank, or else there might be a proper message. Also, if that post is added, it should show in the post lists.
Thanks
Tristup
Change History (11)
#1
@
11 months ago
- Component changed from General to Posts, Post Types
- Focuses administration added
- Keywords needs-screenshots 2nd-opinion added
- Type changed from defect (bug) to enhancement
- Version set to 6.7.1
#2
@
11 months ago
Hi @subrataemfluence ,
Yes, the publish button can be activated once the title is there.
Thanks
#3
@
11 months ago
- Keywords needs-screenshots 2nd-opinion removed
Hey @tristup, Welcome to Trac!
I've looked into this and can confirm that this behavior only occurs in the Classic Editor. The core Gutenberg editor actually prevents this scenario by design - it doesn't allow posts to be published without a title and content.
Screenshot of the classic editor -
Screenshot of the Gutenberg editor -
If you'd like to track or contribute to fixing this issue in the Classic Editor, you can raise it in the plugin's GitHub repository here:
https://github.com/WordPress/classic-editor
#4
@
10 months ago
Hello @abcd95,
I looked into this on my end and found that the Gutenberg editor allows publishing a post/page without a title. Could you confirm if this is the expected behavior?
#5
@
10 months ago
Replying to niravsherasiya7707:
Gutenberg editor allows publishing a post/page without a title. Could you confirm if this is the expected behavior?
Thanks, @niravsherasiya7707, for pointing this out. I meant that the Gutenberg editor doesn't allow publishing a post or page without a title and content. If either of these is present, it can be published. I have updated my comment.
#6
@
4 months ago
Here is the PR that solves the issue for Classic Editor.
Added JavaScript such that it behaves the same as the Gutenberg Editor. The Publish Button remains disabled until either of the fields (Title or Content) is filled.
PR Link: https://github.com/WordPress/classic-editor/pull/226
#8
follow-ups:
↓ 9
↓ 11
@
2 months ago
- Component changed from Posts, Post Types to Editor
- Focuses administration removed
- Version 6.7.1 deleted
Although there is this classic editor plugin to help switch to classic editor capabilities, I believe that this can be solved in core. A check should be in place in the editor to save and throw the corresponding error.
#9
in reply to:
↑ 8
@
2 months ago
@SirLouen, I completely agree with you. This check should be built into the core of WordPress
This ticket was mentioned in PR #10055 on WordPress/wordpress-develop by @akshat2802.
2 months ago
#10
This PR solves : https://core.trac.wordpress.org/ticket/62769
Summary
This PR adds logic to disable the "Publish" button in the Classic Editor interface when both the post title and content fields are empty. The button is automatically re-enabled once either field has valid input.
#11
in reply to:
↑ 8
@
2 months ago
Replying to SirLouen:
Although there is this classic editor plugin to help switch to classic editor capabilities, I believe that this can be solved in core. A check should be in place in the editor to save and throw the corresponding error.
Thanks, @SirLouen, for the review.
I’ve opened a PR in core that matches the current Gutenberg behaviour: the Publish button remains disabled until there is content either in the post title or body.
PR Link: https://github.com/WordPress/wordpress-develop/pull/10055


Hi @tristup
I also think that there should be some validation check, at least for the title. Or, it could be like a
Postmay not be "published" without a title and can only be saved as a draft.Also, it would be great if you could share a screenshot of your 404 page.