Removing Schema Markup on CPT

Posted in: Newspaper
Post count: 11

Please advise how to remove the schema markup on custom post type? it seems that all of my posts are mark as articles.

Post count: 6535

HI

Do you want to remove this metas from custom post types: http://screencast.com/t/6ZrEkhYDT5Fo If so you can use this condition in td_module_single_base.php file: http://screencast.com/t/ExIjUhXVxMMH

if (get_post_type() != 'post'){
return;
}

Hope this helps!
Thanks!

Post count: 11

Hi, it removes the data, but the markup is still there. So when I test with google structured data testing tool, it is giving me errors and warnings.

URL for you to test: http://www.lilkuya.com/job/hr-officer-for-compensation-benefits/

Qn: is there any way not to have any markup on CPT? I just want the markup on ‘post’

  • This reply was modified 9 years by rootheng.
Post count: 22421

Hello,

If you want to remove any markup from custom post types, you will have to add this condition like so:
if (get_post_type()!='post'){
return '';
}

in this file : http://screencast.com/t/H2GDeU7Tm
It will add a check in the code making the metas to not show on anything other than posts.

Thank you!

Post count: 11

Hi, I already added:

Please see: http://www.screencast.com/t/ojEteGKBH

But this is what the google structured data testing tool picked up:

<article id=”post-590″ class=”post-590 job_listing type-job_listing status-publish has-post-thumbnail hentry post” itemscope itemtype=”http://schema.org/Article”&gt;

Showing it is markup as Article and returning errors.

Error showing: http://www.screencast.com/t/uFThcC172Pn

  • This reply was modified 9 years by rootheng.
  • This reply was modified 9 years by rootheng.
Post count: 22421

Well google is looking for an author, a publish date, a headline, a featured image. These things should be present on all custom post types. Please test out our books custom post type and see if the errors are still there and see if the markup is added for it. If you remove the markup, the errors on google won;t go away as it will still see the CPT and provide errors because the markup is missing. The errors are about missing markup not about metas that are already there.
Thank you!

Post count: 11

Hi, I think maybe you don’t understand my question.

If you do not define the type, then there will not be any error. I already mark it as JobPosting, so it already has microdata type as JobPosting. I do not need another type as Article.

As previously mentioned, this is what Google picked up:
<article id=”post-590″ class=”post-590 job_listing type-job_listing status-publish has-post-thumbnail hentry post” itemscope itemtype=”http://schema.org/Article”>
Please see this: http://www.screencast.com/t/EHAWL7cLcqt

What I want:
<article id=”post-590″ class=”post-590 job_listing type-job_listing status-publish has-post-thumbnail hentry post” itemscope itemtype=”http://schema.org/Article&#8221;>
Please see this: http://www.screencast.com/t/l3lMhIdDAsRY

Is this possible?

  • This reply was modified 9 years by rootheng.
Post count: 22421

Please switch to a wp default theme and then test again and see if the structure data comes from the theme or form worpdress. Let us know if the errors are still present on a wp default theme
Thank you!

Post count: 11

Please see the screenshot for the theme twenty fifteen: http://www.screencast.com/t/u44Sr3BHZ

There is no more Article markup. So it should be coming from the theme instead of WordPress.

Thank you for your assistance.

By the way, once I changed back, the markup came back again.

  • This reply was modified 9 years by rootheng.
Post count: 22421

Hi,

I think i get it now Please try it like so:
http://screencast.com/t/JAmcaNWan41
result: http://screencast.com/t/fql5ztHP

Thank you!

Post count: 11

Sorry for the late response. This is update that it works. Thank you.

Viewing 11 posts - 1 through 11 (of 11 total)
The forum ‘Newspaper’ is closed to new topics and replies.