Skip to content

Editor: Warn when the featured image is also in the post - #53332

Open
mehmoodak wants to merge 3 commits into
trunkfrom
add/featured-image-duplicate-notice
Open

mehmoodak wants to merge 3 commits into
trunkfrom
add/featured-image-duplicate-notice

Conversation

@mehmoodak

@mehmoodak mehmoodak commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #

Proposed changes

Many themes show the featured image at the top of a post, so it appears twice when the same image is also in the content.

  • Shows a notice under the featured image when it's also in an Image block in the post or page, with a Preview link and a dismiss button.
  • Adds a "Hide featured image on this post" checkbox. Ticking it hides the image on the post's own page. It still shows as the thumbnail and when the post is shared.
  • The checkbox only shows where hiding is known to work: on block themes whose template has a Featured Image block, and on classic themes that declare Content Options featured image support. Other themes get the notice only.
  • Unticks itself if the duplicate is removed from the content.
  • New beta extension: featured-image-duplicate.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  1. Enable beta blocks: define( 'JETPACK_BLOCKS_VARIATION', 'beta' );
  2. With a block theme (e.g. Twenty Twenty-Five), create a post, set a featured image, and insert the same image in the content.
  3. Under the featured image you should see the notice and the checkbox.
  4. Tick the checkbox and view the post. The image shows once. The blog home still shows the thumbnail.
  5. Back in the editor, remove the image from the content. The checkbox unticks and the notice goes away.
  6. Dismiss the notice, save and reload. It stays dismissed. Set a different featured image that's also in the content, and it comes back.
  7. Repeat on a page. The copy says "page".
  8. With a classic theme without Content Options support, you see the notice only.

No unit tests yet while this is a beta extension; covered by the manual steps above.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mehmoodak mehmoodak added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Oct 7, 2026
@mehmoodak mehmoodak self-assigned this Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/featured-image-duplicate-notice branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/featured-image-duplicate-notice

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

4 files are newly checked for coverage.

File Coverage
projects/plugins/jetpack/extensions/plugins/featured-image-duplicate/editor.js 0/4 (0.00%) 💔
projects/plugins/jetpack/extensions/plugins/featured-image-duplicate/components.tsx 17/24 (70.83%) 💚
projects/plugins/jetpack/extensions/plugins/featured-image-duplicate/featured-image-duplicate.php 78/88 (88.64%) 💚
projects/plugins/jetpack/extensions/plugins/featured-image-duplicate/index.ts 48/50 (96.00%) 💚

Full summary · PHP report · JS report

Coverage check overridden by Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code .

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mehmoodak mehmoodak added the Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code label Oct 7, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Extension] Featured Image Duplicate [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Review This PR is ready for review. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant