Skip to content

644 use manual page selection for llmstxt generation backend side#22395

Merged
leonidasmi merged 15 commits intofeature/llms-txt-phase-2from
644-use-manual-page-selection-for-llmstxt-generation-backend-side
Jul 7, 2025
Merged

644 use manual page selection for llmstxt generation backend side#22395
leonidasmi merged 15 commits intofeature/llms-txt-phase-2from
644-use-manual-page-selection-for-llmstxt-generation-backend-side

Conversation

@thijsoo
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo commented Jul 3, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds the back-end part for manual selection of pages for the llms.txt

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Make sure you have indexables enabled and the SEOO completed.
  • Go to wp-admin/admin.php?page=wpseo_page_settings#/llms-txt and select manual. and choose a page for the About us page section. (or any other page in there)
  • Save the page and re-generate your llms.txt file (by either running the cron or disabling and enabling the feature.
  • Opens your llms.txt file and make sure you see the page you added to the About us page.
  • Open this page and make it a draft. re-generate your file and make sure its gone.
  • Publish it again and now no-index it in the metabox. re-generate your file and make sure its gone.
  • Remove the no-index but now add a password to the post. re-generate your file and make sure its gone.
  • Remove the password. re-generate your file and make sure its there again.
  • Make the page a private one (or a pending one, or a scheduled one). Re-generate your file and make sure it's gone again.
  • Repeat the above tests, but with disabled indexables. (the only difference is that the noindexed page will still appear in the file.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • The automatic selection should stay intact, so check the llms.txt file without the RC and compare it with the file with this RC and automatic page selection. The files should be the same.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

leonidasmi and others added 3 commits July 2, 2025 11:16
… of github.com:Yoast/wordpress-seo into 644-use-manual-page-selection-for-llmstxt-generation-backend-side
@thijsoo thijsoo added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jul 3, 2025
… of github.com:Yoast/wordpress-seo into 644-use-manual-page-selection-for-llmstxt-generation-backend-side
Base automatically changed from 641-create-the-dropdowns-for-the-manual-page-selection to feature/llms-txt-phase-2 July 3, 2025 10:38
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR so far: 🏗️ some remarks.

Also, in the same spirit of my last CR feedback items, I would love if we could make a single source of truth also for the automatic/manual filters of the posts that get into the file.

Explaining: For example, for manual selection when indexables are enabled, we check if ( $indexable->is_public === null || $indexable->is_public == 1 ) before adding a content type entry in the file. We do the very same check when we have an automatic selection: ->where_raw( '( is_public IS NULL OR is_public = 1 )' ).

It would be awesome if that check is in a single place. Same with the manual/automatic selection filters when indexables are not enabled.

Let's talk and maybe find a way that makes sense?

Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
Comment thread src/llms-txt/infrastructure/content/manual-post-collection.php Outdated
thijsoo and others added 3 commits July 7, 2025 12:10
…ckend-side' of github.com:Yoast/wordpress-seo into 644-use-manual-page-selection-for-llmstxt-generation-backend-side
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 7, 2025

Pull Request Test Coverage Report for Build ef7ed4595c313cf8f240aab9ba12185e18bddb9b

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 46 of 137 (33.58%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 53.209%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/llms-txt/infrastructure/content/post-collection-factory.php 0 9 0.0%
src/llms-txt/domain/content-types/content-type-entry.php 0 14 0.0%
src/llms-txt/infrastructure/content/automatic-post-collection.php 37 62 59.68%
src/llms-txt/infrastructure/content/manual-post-collection.php 0 43 0.0%
Totals Coverage Status
Change from base Build cd4a08dd843eeb032687bda01290dd1f11c3dc46: -0.5%
Covered Lines: 29985
Relevant Lines: 57241

💛 - Coveralls

@thijsoo thijsoo marked this pull request as ready for review July 7, 2025 11:46
…ckend-side' of github.com:Yoast/wordpress-seo into 644-use-manual-page-selection-for-llmstxt-generation-backend-side
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR + Acceptance is ✅

@leonidasmi leonidasmi added this to the feature/llms-txt-phase-2 milestone Jul 7, 2025
@leonidasmi leonidasmi merged commit 3345d60 into feature/llms-txt-phase-2 Jul 7, 2025
31 checks passed
@leonidasmi leonidasmi deleted the 644-use-manual-page-selection-for-llmstxt-generation-backend-side branch July 7, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants