Hello,
I am using the ClassicSEO plugin and need some help with the schema output.
The Problem:
The plugin correctly outputs Organization
and LocalBusiness
schema, but it does so on every page of my website, including tag and category archives. According to Google’s Rich Results Test, this schema appears on my tag archive pages.
My Goal:
I want to disable this global Organization
/LocalBusiness
schema on all archive pages (tags, categories, etc.) so that my own custom function can output a more appropriate CollectionPage
schema on these pages. I only want the Organization
/LocalBusiness
schema to appear on my homepage or contact page.
What I have tried so far (without success):
- Plugin Settings: I have set the “Contact Page” and “About Page” in the “Local SEO” settings, but this did not stop the schema from appearing on archive pages.
- remove_action in functions.php: I used Query Monitor and found the function
Classic_SEO\Frontend\Add_Attributes->add_attributes()
running on thewp_head
hook with priority 99. My attempts to remove it with a custom function have failed. - Output Buffering: I even tried to remove the script from the final HTML output using
ob_start()
andpreg_replace()
, but this also failed to remove the plugin’s schema.
My Question:
Is there a specific setting I am missing, or what is the correct PHP filter or action I should use in my functions.php
to prevent the Organization
and LocalBusiness
schema from being output on archive pages?
Thank you for your help!