Skip to content

llms.txt to use the primary category URL for the posts #22337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 of 11 tasks
josevarghese opened this issue Jun 10, 2025 · 1 comment
Open
5 of 11 tasks

llms.txt to use the primary category URL for the posts #22337

josevarghese opened this issue Jun 10, 2025 · 1 comment

Comments

@josevarghese
Copy link
Contributor

josevarghese commented Jun 10, 2025

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

If multiple categories are selected on a post and the last category on the list is selected as the primary category, we output the permalink on the llms.txt with the URL having the first category selected on the post. As we output the canonical URL based on the primary category selected on the page, we need to output the primary category URL on the llms.txt, too.

To Reproduce

Step-by-step reproduction instructions

  1. Set the permalinks for the post as /%category%/%postname%/
  2. Create a new post with categories abcd, efgh, and xyz.
  3. Select all the above categories for the post
  4. Then select the xyz as the primary category and publish the post
  5. Check the permalink for the post showing on the post, and you can notice that the URL would be /xyx/postname (having the selected primary category slug)
  6. Open the /llms.txt file and you can notice that the permalink of the newly published with the URL is added with the slug as abcd/postname

Expected results

  1. The permalink for the post having the primary category needs to be output on the LLMS.txt file

Actual results

  1. We are outputting the permalink having the first occurring alphabet category selected on the post

Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

Image
Permalink of the post showing the primary category xyz correctly
.
.

Image
URL showing on the llms.txt having the first category selected on the post, which is abc, even though the URL on the permalink for the post is xyz (the primary category)

Technical info

  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • Other:
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other:

Used versions

  • Device you are using:
  • Operating system: Windows 11
  • PHP version:
  • WordPress version: 6.8.1
  • WordPress Theme:
  • Yoast SEO version: 25.3
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
@josevarghese
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant