Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove hentry from post_class()
<?php
/**
* Remove 'hentry' from post_class()
*/
function ja_remove_hentry( $class ) {
$class = array_diff( $class, array( 'hentry' ) );
return $class;
}
add_filter( 'post_class', 'ja_remove_hentry' );
@Jawanet

This comment has been minimized.

Copy link

commented Jan 9, 2014

good brother www.alambudidaya.com

@abumalick

This comment has been minimized.

Copy link

commented Sep 15, 2015

It works but if I visit my website with https, the browser hangs and don't load the page ...
I putted the script in functions.php of my theme

@Zetadisseny

This comment has been minimized.

Copy link

commented Aug 31, 2016

Hey Jare! Thanks for share i test in my site zetadisseny.es

@Bonjur

This comment has been minimized.

Copy link

commented Sep 14, 2016

Will removing schema trigger a Google penalty? What are the consequences? Gbwhatsapp

@naazg

This comment has been minimized.

Copy link

commented Jan 15, 2017

Hello, My website http://www.designsmag.com shows an error on hentry : missing updated but when i test live data it won't show any error. 0 error 0 warning.. what might be the issue?

@Lauyou01

This comment has been minimized.

Copy link

commented Feb 6, 2017

I am still getting the error on www.lauyou.com

@aafirasheikh

This comment has been minimized.

Copy link

commented Feb 13, 2017

i have fixed it at Software Development Company

@welcomecode

This comment has been minimized.

Copy link

commented Apr 27, 2017

Sir, I am getting hentry problem only for my WordPress Tutorial site pages, I am using Voice theme.

@ngabidin

This comment has been minimized.

Copy link

commented May 22, 2017

@sdynamo

This comment has been minimized.

Copy link

commented Jun 12, 2017

Hello, thank you for the code. I was looking for a way to remove hentry from my website pages as it was irritating to see red warning sign in Google Webmaster Tools / Search Console.
The website is CityShoppingPoint a Local Business Directory & Events.
For the type of website I don't see it necessary having hentry codes. And it works flawlessly without having to use plugins.
I suppose it should be working for any themes as well.

@daniushko

This comment has been minimized.

Copy link

commented Jan 2, 2018

I can't find the author in my single.php file. I'm using the ThemeForest's photography theme. Can anyone help?
https://swansphotography.com/

@apktopsblog

This comment has been minimized.

Copy link

commented Jan 22, 2018

thank you
very useful www.apktops.ir

@kresnabudi

This comment has been minimized.

Copy link

commented Feb 8, 2018

thanks share solved for insa.or.id

@Paulnwachukwu

This comment has been minimized.

Copy link

commented Feb 14, 2018

Thanks a lot worked for me on. BloggerSpy

@jamielsharief

This comment has been minimized.

Copy link

commented May 4, 2018

Hey, having the same issue at cold email software blog, will try this.

@asdsesdee

This comment has been minimized.

Copy link

commented May 10, 2018

i see 7 hentry error on my website .. but on live test is no error is show on live test
why ???
help me sir

@rotipisju

This comment has been minimized.

Copy link

commented Jun 10, 2018

i have any error on my website Viagra asli and my second website in Jual viagra in my web on Obat kuat viagra

@andpiazza

This comment has been minimized.

Copy link

commented Aug 20, 2018

Reason why this code does NOT work is: it removes hentries from posts, when in reality it needs to remove from pages, categories and tags.
If anything, removing hentries from posts might HURT your SEO results: hentries are designed to capture articles' meta data so that's exactly where you want it to show.

I posted here code that does removes hentries from pages categories and tags: https://github.com/andpiazza/remove_hentry_wordpress

@softimuscu

This comment has been minimized.

Copy link

commented Aug 31, 2018

The @andpiazza solution works for me:

https://github.com/andpiazza/remove_hentry_wordpress

Thank so much... 5 star !!!

@ardyfeb

This comment has been minimized.

Copy link

commented Oct 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.