How to Remove Website Schema Markup
-
Hi,
https://www.xtremerain.com/ this is my website. I’m using yoast seo plugin too. In structure data testing too, i see two itemprop of website markup. I want to stop Add Meta Tags to do it for me while Yoast is doing it. I don’t want to deactivate your plugin, because i’m using it for adding other metadata.
-
Hello,
Please try adding the following code in the
functions.php
file of the theme or in a custom plugin:function amt_schemaorg_skip_front_page( $metatags ) { if ( is_front() || is_home() ) { return array(); } return $metatags; } add_filter( 'amt_schemaorg_metadata_footer', 'amt_schemaorg_skip_front_page' );
It should stop adding schema.org metadata on the front/home page. Please let me know if it works as expected.
Also, thanks for your review. Much appreciated.
Kind Regards,
GeorgeHi. Welcome. And Thank you for this code. It is working. But it is breaking my theme sidebar and layout.
But it is breaking my theme sidebar and layout.
Hi, this is strange. I cannot think of any way in which it could cause such an issue. The code returns an empty array so the plugin prints nothing to the page… Could you please check if there is any other related customization of add-meta-tags in the functions.php file of the theme?
Hi,
See this is my function.php file https://drive.google.com/file/d/0Bw44Pb1XK4b3SHdHNEtIbmxRMzg/view?usp=sharingOn a second thought, even the existence of other customizations could not possibly affect your theme.
George
hm. I deactivated SEO by Yoast and Jetpeck and tried your code. But no changes. I’m confused.
Hi,
See this is my function.php file https://drive.google.com/file/d/0Bw44Pb1XK4b3SHdHNEtIbmxRMzg/view?usp=sharingWow, that’s a lot of code! ?? I cannot locate any filter hook prefixed with
amt_
(the Add-Meta-Tags prefix), so no extra Add-Meta-Tags customization exists in that file.And admin bar also disappeared. It’s showing white blank space. See the screenshot – https://i.imgur.com/eh7DE8S.jpg
The plugin adds the following code to the front page:
<!-- BEGIN Metadata added by Add-Meta-Tags WordPress plugin --> <!-- Scope BEGIN: WebSite --> <span itemscope itemtype="https://schema.org/WebSite"> <meta itemprop="name" content="XtremeRain" /> <meta itemprop="url" content="https://www.xtremerain.com/" /> <!-- Scope BEGIN: SearchAction --> <span itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction"> <span itemprop="target" itemscope itemtype="https://schema.org/EntryPoint"> <meta itemprop="urlTemplate" content="https://www.xtremerain.com/?s={search_term}" /> </span> <!-- Scope END: EntryPoint --> <span itemprop="query-input" itemscope itemtype="https://schema.org/PropertyValueSpecification"> <meta itemprop="valueRequired" content="True" /> <meta itemprop="valueName" content="search_term" /> </span> <!-- Scope END: PropertyValueSpecification --> </span> <!-- Scope END: SearchAction --> <!-- Scope BEGIN: Organization --> <span itemprop="publisher" itemscope itemtype="https://schema.org/Organization"> <meta itemprop="name" content="XtremeRain" /> <meta itemprop="description" content="Tech And Lifestyle Solutions, Tips And Tricks" /> <meta itemprop="logo" content="https://www.xtremerain.com/wp-content/uploads/2015/05/xtremerain-favicon-554d244ev1_site_icon.png" /> <meta itemprop="url" content="https://www.xtremerain.com/" /> <meta itemprop="sameAs" content="https://plus.google.com/+XtremeRain" /> <meta itemprop="sameAs" content="https://www.facebook.com/xtremerain" /> <meta itemprop="sameAs" content="https://twitter.com/xtremerain" /> </span> <!-- Scope END: Organization --> </span> <!-- Scope END: WebSite --> <!-- END Metadata added by Add-Meta-Tags WordPress plugin -->
Adding it in a sample minimal HTML document as shown below and running it through a HTML 5 validator shows that the added code is 100% valid. So its removal could not possibly affect the rest of the theme.
<!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <p></p> <!-- BEGIN Metadata added by Add-Meta-Tags WordPress plugin --> <!-- Scope BEGIN: WebSite --> <span itemscope itemtype="https://schema.org/WebSite"> <meta itemprop="name" content="XtremeRain" /> <meta itemprop="url" content="https://www.xtremerain.com/" /> <!-- Scope BEGIN: SearchAction --> <span itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction"> <span itemprop="target" itemscope itemtype="https://schema.org/EntryPoint"> <meta itemprop="urlTemplate" content="https://www.xtremerain.com/?s={search_term}" /> </span> <!-- Scope END: EntryPoint --> <span itemprop="query-input" itemscope itemtype="https://schema.org/PropertyValueSpecification"> <meta itemprop="valueRequired" content="True" /> <meta itemprop="valueName" content="search_term" /> </span> <!-- Scope END: PropertyValueSpecification --> </span> <!-- Scope END: SearchAction --> <!-- Scope BEGIN: Organization --> <span itemprop="publisher" itemscope itemtype="https://schema.org/Organization"> <meta itemprop="name" content="XtremeRain" /> <meta itemprop="description" content="Tech And Lifestyle Solutions, Tips And Tricks" /> <meta itemprop="logo" content="https://www.xtremerain.com/wp-content/uploads/2015/05/xtremerain-favicon-554d244ev1_site_icon.png" /> <meta itemprop="url" content="https://www.xtremerain.com/" /> <meta itemprop="sameAs" content="https://plus.google.com/+XtremeRain" /> <meta itemprop="sameAs" content="https://www.facebook.com/xtremerain" /> <meta itemprop="sameAs" content="https://twitter.com/xtremerain" /> </span> <!-- Scope END: Organization --> </span> <!-- Scope END: WebSite --> <!-- END Metadata added by Add-Meta-Tags WordPress plugin --> </body> </html>
Used this HTML 5 validator.
George
And admin bar also disappeared. It’s showing white blank space. See the screenshot – https://i.imgur.com/eh7DE8S.jpg
I have no explanation about how this could possibly be happening by using the the sample code I posted earlier..
Could you please completely log out, clean your browser cache and try visiting your website again while the code I posted earlier exists in functions.php?
Also, I’d highly recommend testing the code with a default theme.
George
No changes. And see this website – This is also having same issue. https://www.tunerpata.com/
This is only happening when i enable Automatically generate and embed Schema.org Microdata. (Experimental feature)
I’m not sure, why it is happening.
Regarding the layout, could you please describe in more detail what I should be expecting to see?
Also, could you please check using one of the default themes, eg twentyfifteen, and provide some instructions about how to reproduce the issue and what I should expect to see?
Can you confirm that the issue starts to appear when the code I posted earlier is added to the
functions.php
file? If the code is not added, is your web site’s layout in tact?George
Anyway, George! I fixed this problem ??
I used this codefunction amt_schemaorg_skip_front_page( $metatags ) { if ( is_home() ) { return array(); } return $metatags; } add_filter( 'amt_schemaorg_metadata_footer', 'amt_schemaorg_skip_front_page' );
instead of
function amt_schemaorg_skip_front_page( $metatags ) { if ( is_front() || is_home() ) { return array(); } return $metatags; } add_filter( 'amt_schemaorg_metadata_footer', 'amt_schemaorg_skip_front_page' );
The only change is i deleted is_front() || from your code. And it works.
Thank you so much ?? I really appreciate you ??
This is only happening when i enable Automatically generate and embed Schema.org Microdata. (Experimental feature)
I see. Due to the way the microdata is added by the plugin, your content is enclosed in an extra div element when the schema.org generator is enabled.
If your CSS tries to match the content’s div element using the element hierarchy instead of using the content’s div ID or class, then matching it would be impossible and thus no style could be applied, which would make the theme break.
Using the JSON+LD schema.org generator would be a solution, but thius is a very new feature and the code is not mature enough. If you use it in production, please make sure you check your pages thoroughly.
George
- The topic ‘How to Remove Website Schema Markup’ is closed to new replies.