Skip to content

Make sure pages are before posts in the render list.#22410

Merged
leonidasmi merged 2 commits intofeature/llms-txt-phase-2from
660-move-pages-above-posts-in-the-llmstxt-file
Jul 9, 2025
Merged

Make sure pages are before posts in the render list.#22410
leonidasmi merged 2 commits intofeature/llms-txt-phase-2from
660-move-pages-above-posts-in-the-llmstxt-file

Conversation

@thijsoo
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo commented Jul 8, 2025

Context

  • We want to render pages as the first item in the list.

Summary

This PR can be summarized in the following changelog entry:

  • Makes sure pages are the first entry in 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:

  • Re-generate your llms.txt file and make sure pages are now the first entry in the list.
  • Disable pages in indexables and make re-generate your llms.txt file. Make sure pages are gone. Use:
add_filter( 'wpseo_indexable_excluded_post_types', function( $post_types ) { 
    $post_types[] = 'page'; 
    return $post_types;
} );
  • Remove the filter and run the SEOO
  • Disable posts in indexables and make re-generate your llms.txt file. Make sure posts are gone. Use:
add_filter( 'wpseo_indexable_excluded_post_types', function( $post_types ) { 
    $post_types[] = 'post'; 
    return $post_types;
} );
  • Remove the filter and run the SEOO
  • Disable posts and pages in indexables and make re-generate your llms.txt file. Make sure posts and pages are gone. Use:
add_filter( 'wpseo_indexable_excluded_post_types', function( $post_types ) { 
    $post_types[] = 'page'; 
    $post_types[] = 'post'; 
    return $post_types;
} );

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:

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 #

@thijsoo thijsoo added this to the feature/llms-txt-phase-2 milestone Jul 8, 2025
@thijsoo thijsoo added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jul 8, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 8, 2025

Pull Request Test Coverage Report for Build f0362eb485bcbb24d7e609c7bf1c3a34ae3e133b

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

  • 5 of 7 (71.43%) changed or added relevant lines in 1 file are covered.
  • 230 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.5%) to 53.097%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/llms-txt/infrastructure/markdown-services/content-types-collector.php 5 7 71.43%
Files with Coverage Reduction New Missed Lines %
src/llms-txt/infrastructure/content/manual-post-collection.php 21 0.0%
src/llms-txt/user-interface/available-posts-route.php 22 0.0%
src/integrations/settings-integration.php 187 24.82%
Totals Coverage Status
Change from base Build f494d67ac19ad5e126ab1f77491f6da4fae57851: -0.5%
Covered Lines: 29990
Relevant Lines: 57361

💛 - Coveralls

@leonidasmi leonidasmi merged commit a1e74a9 into feature/llms-txt-phase-2 Jul 9, 2025
25 checks passed
@leonidasmi leonidasmi deleted the 660-move-pages-above-posts-in-the-llmstxt-file branch July 9, 2025 09:38
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