How to Find Which WordPress Plugin Actually Generated a Canonical Tag
Two canonical tags on the same page. WordPress settings look correct. So why is the live HTML different? If you manage WordPress sites for clients, you've probably hit this: the SEO plugin settings say one thing, but the actual rendered <head> says another. Multiple plugins, a theme, and a page builder can all end up touching the same tag. Here's the debugging approach I use before touching…
When multiple plugins, a theme, and a page builder are involved in generating a canonical tag on the same WordPress page, the SEO plugin settings may not reflect the actual HTML output. To determine which plugin ultimately creates the canonical tag, follow this debugging approach:
1. Examine the live page's rendered head section, not just the settings screen. The WordPress admin may show what a plugin intends to output, but other components can override or modify it before it reaches the browser.
2. Identify every component that hooks into wp_head by checking for add_action( 'wp_head', 'my_callback', 10 );. Multiple plugins, themes, and page builders often contribute to SEO output, so it's essential to pinpoint all contributors.
3. Use Query Monitor, a free plugin, to list every wp_head callback with its priority and source file. This step converts guesswork into a quick five-minute check, revealing the actual source file rather than just the plugin's settings screen.
4. Once you have the file path from Query Monitor, you can determine which plugin or theme owns the source file, providing the real answer to the canonical tag's origin.
5. If you suspect a competing hook removal in production, test the change on staging first. A tag that appears redundant may be crucial for other functionalities like hreflang, verification tags, or plugin-specific integrations.
This debugging method is particularly useful during migrations between SEO plugins. Capture the rendered head of various page types (homepage, posts, archives, WooCommerce products, local pages), then compare the results after switching plugins. Missing tags, such as canonical, robots directives, Open Graph/Twitter tags, JSON-LD, verification tags, or hreflang, should be investigated, as their absence is usually more problematic than mere changes.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.