[Feature]: Issue 240 | SEO Descriptions#318
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #318 +/- ##
=============================================
+ Coverage 63.89% 64.84% +0.94%
- Complexity 680 740 +60
=============================================
Files 49 53 +4
Lines 3518 3780 +262
=============================================
+ Hits 2248 2451 +203
- Misses 1270 1329 +59
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I've updated the experiment title to "Meta Description Generation" -- let me know if we should roll this up into the Excerpt UI instead.
Done.
Done.
This is because metadata isn't saved with Drafted posts by default. I had to define the |
src/experiments/meta-description/components/MetaDescriptionModal.tsx
Outdated
Show resolved
Hide resolved
tests/Integration/Includes/Abilities/Meta_Description/SEO_IntegrationTest.php
Show resolved
Hide resolved
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
This all looks good to me, nice work here @TylerB24890! The only last comment/question I had, which I left in a threaded comment but pulling out here for easier tracking, is whether we want to actually render a meta description tag if no SEO plugin is installed? Right now you can generate the meta description but if you aren't using an SEO plugin (which if we're honest is probably a small percentage of sites) this field is never used anywhere. Curious for your thoughts here @jeffpaul |
That's a good flag. We don't really have a good way to determine if its already being rendered or not unless a known plugin is active (besides parsing the rendered page, which I wouldn't consider a good way) If we decide to limit this to an SEO plugin being active would we hide the experiment activation all together or just the UI from the block editor? |
I wouldn't personally. I think this is still a good feature to have, even though I'd expect most SEO plugins today to have their own AI integrations. So I think it's good that we change where the data is stored depending on if an SEO plugin is active but I wouldn't disable everything if a plugin is active. Just wondering if we should output the meta tag if no SEO plugin is active but leave everything else as-is. |
|
Let's output the meta tag if no SEO plugin is detected, worst case there are dupe tags on that page? |
@jeffpaul @dkotter I've added some logic to hook into |
|
@dkotter It appears the inclusion of the This is also happening in the recently merged Content Classification experiment E2E tests. I'm pretty positive this did work prior to me merging the most recent
|




What?
Closes #240
This PR introduces a new Experiment "Meta Descriptions" which provides AI generated meta description support.
Why?
Meta descriptions are an important aspect of a pages SEO, yet they are often overlooked or lacking in quality. See #240 for more detail.
How?
This Experiment introduces a new panel to the block editor
PluginDocumentSettingPanelfor managing the SEO meta description for the current post. The initial view provides a simple button to "Generate Meta Description". On click of the button, a modal window opens which shows the suggested meta descriptions returned from the AI and aTextAreaControlinput allowing editors to manipulate the suggested descriptions prior to saving them to the post.On select of a suggestion, the
TextareaControlcomponent is populated with the selected suggestion at which point the editor can update the text as needed.From there, editors have a few options;
TextareaControlcomponent to the appropriate meta key_meta_descriptionkey is stored.TextareaControlto the users clipboard.Various filters are available for customizing the experiment;
wpai_meta_description_prompt- Attach additional (or modify) context sent to the AI for the meta descriptionwpai_meta_description_result_temperature- The temperature threshold for the model. Default is0.7wpai_meta_description_seo_plugin- The supported SEO plugins in['file' => 'path', 'meta_key' => 'key' ]format.wpai_meta_description_meta_key- Override the meta key the description is saved to. This will take priority over any plugin configurations.wpai_meta_description- Override the output of the meta description. This filter only runs when an SEO plugin is not detected.Use of AI Tools
Testing Instructions
_meta_descriptionkey.Screenshots or screencast
Initial State:

Generated Descriptions:

Selected Description:

Saved Description:
