Skip to content
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

Canonical URL placeholder shows wrong URL on subdirectory install #703

Open
loilo opened this issue Dec 18, 2024 · 0 comments
Open

Canonical URL placeholder shows wrong URL on subdirectory install #703

loilo opened this issue Dec 18, 2024 · 0 comments

Comments

@loilo
Copy link

loilo commented Dec 18, 2024

Describe the bug
The SEO Framework outputs

How to reproduce the bug

Conveniently, we can use the WordPress Playground to demo the issue as every playground runs in a subdirectory.

  1. Go to https://playground.wordpress.net/?plugin=autodescription
  2. Go to Pages → Sample Page and click "Edit" (or paste /wp-admin/post.php?post=2&action=edit into the virtual browser)
  3. Activate the "Visibility" tab of the SEO settings and notice how the placeholder deviates from what the actual URL is
    when opening the page or clicking on the "Link" in the sidebar (see screenshot below).

Expected behavior
The actual canonical URL should be shown as the placeholder.

Screenshots
Screenshot of the WordPress backend editing the mentioned page, with both the correct and the incorrect canonical URL showing side by side

Additional context
It's worth noting that the server-side filling of the placeholder actually puts in the correct URL (not really demonstratable in the playground). It's the JavaScript code (tsfCanonical.updateStateOf) running after that which leads to the incorrect value.

@sybrew sybrew added this to the 5.1.3 milestone Dec 19, 2024
@sybrew sybrew changed the title Canonical URL placeholder showing wrong URL when running WordPress in a sub directory Canonical URL placeholder shows wrong URL on subdirectory install Dec 19, 2024
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

2 participants