Hentry issues

Markup issues with the Hentry tag entry-content become pure code.
It’s a section with global block. This we don’t want to be considered as entry content. Since it’s not header content is to be honest. But nevertheless this block is critical and should not show pure code as entry-content or anything from that block.

See print in secure note.

Worth to ask, how do we swap from Hentry to Article markup? we have Snippet plugin from you guys. But Hentry is on the markup and ot article.

Hello There,

Thanks for writing in!

You are experiencing this issue because you inserted a global block at the very first section of the page. With global blocks, it has some css codes that is necessary in order to display the global block correctly. You may need to make sure that a text block is displayed first in the site in order to prevent this from happening. The Google Structured Data Tool displays the very first column which contains the code and this is what is displayed evidently in your screenshot. Please edit your page and re structure it. A text block must be displayed first before the global block so that Google will pick the text block first.

Hope this helps.

Will have a look during the day. but that’s not the structure we want. How do we swap to article markup instead of hentry?

Hi There @bracas

Hentry is already within Article markup as you can see below.

Could you please explain what you would like to accomplish, so that we should be able to assist you further.

Thanks!

Hentry and article markup is two different thinks if you know schema.org

What Hentry is coming from I don’t know. Your snippet plugin use Article markup not hentry.

Since hentry fetch the entry content from the block and it becomes pure code which is not acceptable for us we wonder what about to swap to article and control it in the cms instead of automation.

We want that block in the top since we have another block in the bottom as you see.

What I want is not to have entry content as pure code, I want text. either first paragraph of page or custom one which can be done with snippet and article markup. We have that plugin but either way it takes Hentry and not article markup you should be able to answer that better than me.

I tried now to add entry-content class to the first text block I want it to pick from and it actually overrides and take it to be the entry-content in the Hentry markup.

Is it possible to write a custom php code in the child functions.php to create another name of the class so we don’t use a class that is for something else. Which then Hentry use to fetch entry-content? :slight_smile:

Same for the entry-title.

Do you understand what I’m trying to do? :slight_smile: Make hentry listen to another class or just make the automated default entry-content and entry-title in the template to be removed and we place it where we want it.

Worst case senario:
If we do as I hacked it now is tis classes used for something else in the theme so it could break or we might break something else by having duplicates?

Hello There,

Thanks for updating in!

Please understand that hentry is generated by WordPress post_class().
https://codex.wordpress.org/Function_Reference/post_class

The hentry is generated in the article element wrapping the entry content of the page. This is how WordPress works and that Google Structure data tool will look for this. More about hentry were explained here: http://microformats.org/wiki/hentry, https://en.wikipedia.org/wiki/HAtom,

In this case, since Google will fetch the content from the .hentry class, it is not advisable to insert custom codes before any of the page/post contents.

Hacking this page without adding any piece of code or affecting any other pages, post or feature, you can insert a section at the top of your global block. Insert a section, row and a column. Within the column insert a text element and add a short description regarding this page and that you wanted this description to appear as the entry content in Google Structured Tool. Yes I know you do not want anything above the global block. You just simply want the global block to appear first. Just hear me out and do my suggestion. Once the section is in place, find the “Customize” tab in the section settings and enable the “Hide During Breakpoints” option for all screen so that this section will not visible and only the Google Structure Tool will see this thus fetching the short description that you have added first and not the code coming from your Global block.

For more details about the “Hide During Breakpoints” option, please check this out: https://theme.co/apex/forum/t/hide-during-breakpoint-explained/17378

Hope this helps.

I see what you say but it’s only moving the entry content to it’s right location. No we can not move the global block. There is a solution to this without adding anything above.

:scream:What you suggest is considered to be cloaking if you don’t know that: https://support.google.com/webmasters/answer/66355?hl=en

Google just want to see the entry-content and I’m fairly sure you guys know how to move or let hentry listen to other css classes. Or remove it form where it now is?

But it looks like we will be moving towards Article markup in snippet instead. When we active it for pages, will hentry be removed then? So that we don’t have duplicate tags for the same purpose and hentry with code data which we don’t want.

Hello There,

hentry will always be the post class default of the article element because it is generated by WordPress. If you really want to remove it so that you can hack it your way and add the hentry class in your text element, you can check out the code used in this link:

Hope this helps.

Ok thanks will have a look.

But we will most probably go for article markup from your plugin snippet. When we active it on pages will hentry be removed so we don’t have duplicate markup? Or how do we then remove hentry markup?

Is this the only way to remove it? Even if we go for the Article markup in your snippet plugin? or do your plugin remove Hentry when Article is activated?

Update: I tried to enable but Hentry is still there and should be removed. That should be done automatically by your plugin according to me so. I assume this will become useful for many users here. How should we remove the markup for hentry to work as it should with the theme and snippet. No hack just remove it.

Tried but does not remove it. And yes I’ve cleared cache from all instances and also tried to bypass apache it’s easy just ?what-ever-you-want or NGING ?page=what-ever-you-want

How do I remove hentry? Tried different code versions. What’s the time to answers now? been waiting for a while for a response.

Such as this one: https://gist.github.com/jaredatch/1629862 suggest from Yoast.

None of the code I’ve tried is working I need assistant asap thanks.

Hello There,

I have tested the code and it works for me. Adding this code in the child theme’s functions.php file should remove the .hentry in the article element classes.

/**
 * 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' );

By the way, just for future topics, self responding or bumping your post pushes it back in our Queue system so it takes longer to respond to.

Please provide us access to your site so that we can place the code correctly and test whether the code works for your site. And if you like to install a 3rd party plugin, you may also install this plugin: https://wordpress.org/plugins/no-hentry/

Please let us know how it goes.

I’m trying that code but then the site does not load. And it’s exactly the code you posted here.

Our staging site has some issues so I can not share you that one to test but this is our functions.php in child theme so you can have a look. Preferably do not add that plugin to the plugin stack, and it’s not updated for a long time.

Ok thanks for letting me now, even when I edit my reply?

Hope that you can read the functions.php in the secure note. Maybe you find the issue why it breaks the site when adding the code or not removing the hentry?

I know we can remove a few lines that does not apply/is needed anymore but I did not want to mess with the functions.php file at this moment.

The code worked now! but now we receive the hcard instead can we remove that one as well?

Update: Never mind I solved that one as well. it was fired from custom php in funtions.php that was missing from the default hentry. So removed that rows as well thanks! Problem solved.

Glad you have sorted it out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.