Skip to content

Fix[Meta Description]: Allow clearing meta description#706

Merged
dkotter merged 1 commit into
WordPress:developfrom
yogeshbhutkar:fix/allow-setting-empty-meta-description
Jun 12, 2026
Merged

Fix[Meta Description]: Allow clearing meta description#706
dkotter merged 1 commit into
WordPress:developfrom
yogeshbhutkar:fix/allow-setting-empty-meta-description

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Follow-up to #696

This PR updates the meta description flow so users can clear a previously applied meta description when they decide it is not needed. Previously, the modal disabled the Apply button for an empty textarea, which prevented users from returning the post to its default “no meta description” state through the UI.

The change allows a truly empty value to be applied, while still blocking whitespace-only input because saving only spaces has no practical value. After clearing the description, the panel returns to the empty state and restores focus to the Generate Meta Description button.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Code review

Testing Instructions

  1. Create or open a post.
  2. Generate a meta description.
  3. Apply the generated description and confirm it appears in the panel.
  4. Edit the description, remove all text, and click Apply.
  5. Confirm the description is cleared and the Generate Meta Description button is shown and focused.
  6. Try entering only spaces in the modal and confirm Apply remains disabled.
  7. Save/update the post and confirm the empty meta description is not output on the front end.

Screencast

screencast.mov

Changelog Entry

Fixed - Allow users to clear an applied meta description while preventing whitespace-only descriptions.

Open WordPress Playground Preview

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review June 12, 2026 06:30
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dkotter dkotter added this to the 1.1.0 milestone Jun 12, 2026
@dkotter dkotter merged commit 6e158ad into WordPress:develop Jun 12, 2026
23 of 24 checks passed
@yogeshbhutkar yogeshbhutkar deleted the fix/allow-setting-empty-meta-description branch June 12, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants