edit the WPSEO_Schema_Person piece
-
I need to edit the opengraph piece for WPSEO_Schema_Person.
What I need to do is add “url” to the “person” schema to solve a jsonLD error ie.
https://www.dropbox.com/s/ehee5k5au6ixmjv/3BaeNVq610.png?dl=0I’ve tried EVERYTHING and the documentation does not explain how to do this, and following it carefully it seems I should be able to hook into wpseo_schema_person, but looking at $data it is blank so i have no idea why it isnt working.
The page I need help with: [log in to see the link]
-
Hi,
We would like some more information.1. Can you confirm you are using WordPress 5.2.1? You can check by clicking on the W in the top left and selecting About. If you need to update, please check with your host provider.?Please know that if you are using an older version of WordPress Core you may experience unexpected behavior with Yoast.?This guide explains more:?https://yoast.com/why-we-dont-support-old-wordpress-versions/.
2. Can you confirm you are using the most recent Yoast SEO, v11.3?
3. Can you provide an example of the code you are using?
1. yes.
2. yes.
3. What code I am using? I’m not using any code… I’m asking for a code snippet to help me completely remove WPSEO_Schema_Person. As I indicated I tried a few examples from your docs but never found out how to access or remove that block of schema, or how to edit it as I wish or overwrite it.At the moment I have just completely disabled yoasts schema markup and reverted back to using my own because of this and other issues with the schema not being as advanced as we needed.
First thing first if you enable the Yoast SEO specific Schema and test the relevant page using the Google Structured Data Testing tool, do you see the same error?
We also see that you have an additional set of
author
Schema which isn’t generated by Yoast SEO. The following is generated from a 3rd party source:<script type="application/ld+json"> { "@context":"https://schema.org", "@type":"BlogPosting", "@id":"post-8477", "mainEntityOfPage":"https://www.freelancerfinancials.co.uk/blog/contracting/optimum-contractor-salary-dividend-split-2019-20/", "headline":"Ltd Co contractor optimum salary vs dividend split 2019/20", "datePublished":"2019-05-21T11:01:28+00:00", "position":"https://www.freelancerfinancials.co.uk/blog/contracting/", "dateModified":"2019-05-25T02:09:37+00:00", "image": { "@type": "ImageObject", "url": "https://freelancerfinancials.freetls.fastly.net/wp-content/themes/template/images/freelancerfinancials-logo.png", "width": "353", "height": "57" }, "author": { "@type": "Person", "name": "John Yerou", "sameAs": "https://twitter.com/yeroujohn", "url": "https://twitter.com/yeroujohn", "jobTitle": "CEO" }, "publisher": { "@type" : "Organization", "name" : "Freelancer Financials", "url" : "https://www.freelancerfinancials.co.uk", "logo" : { "@type": "ImageObject", "url": "https://freelancerfinancials.freetls.fastly.net/wp-content/themes/template/images/freelancerfinancials-logo.png", "width": "353", "height": "57" }, "contactPoint" : [ { "@type" : "ContactPoint", "telephone" : "+44 208 421 7999", "contactType" : "customer service", "areaServed" : "GB", "availableLanguage" : "English" } ], "sameAs" : [ "https://www.facebook.com/FreelancerFinancials", "https://twitter.com/contractorIFA", "https://en.wikipedia.org/wiki/Mortgage_industry_of_the_United_Kingdom#Contractor_Mortgages" ], "address": { "@type": "PostalAddress", "addressLocality": "Middlesex", "addressCountry": "GB", "addressRegion": "Greater London", "postalCode": "HA5 4HS", "streetAddress": "Freelancer Financials, Avondale House, 262 Uxbridge Road, Hatch End, Pinner, Middlesex, HA5 4HS" }, "telephone": "+44 208 421 7999", "parentOrganization": { "@type": "FinancialService", "priceRange": "10,10000", "address": { "@type": "PostalAddress", "addressLocality": "Middlesex", "addressCountry": "GB", "addressRegion": "Greater London", "postalCode": "HA5 4HS", "streetAddress": "Mortgage Quest, Avondale House, 262 Uxbridge Road, Hatch End, Pinner, Middlesex, HA5 4HS" }, "founder":[ { "@type": "Person", "name": "John Yerou", "sameAs": "https://twitter.com/yeroujohn", "url": "https://twitter.com/yeroujohn", "jobTitle": "CEO" } ], "name": "Mortgage Quest Ltd", "email": "[email protected]", "geo": { "@type": "GeoCoordinates", "latitude": "51.8292189", "longitude": "-0.4792006" }, "openingHoursSpecification": [ { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Thursday", "opens": "08:00:00" }, { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Tuesday", "opens": "08:00:00" }, { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Friday", "opens": "08:00:00" }, { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Saturday", "opens": "08:00:00" }, { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Monday", "opens": "08:00:00" }, { "@type": "OpeningHoursSpecification", "closes": "19:00:00", "dayOfWeek": "Wednesday", "opens": "08:00:00" } ], "telephone": "+44 208 421 7998", "url": "https://www.mortgagequest.co.uk", "logo" : "https://www.mortgagequest.co.uk/images/images/header_01.jpg", "image" : "https://www.mortgagequest.co.uk/images/images/header_01.jpg" } } } </script>
So, we believe disabling the additional sets of
author
Schema will fix the error as if you have selectedOrganization
from Yoast SEO > Search Appearance > General (tab) > Knowledge Graph & Schema.org option as the site cannot have the both Organization and Person Schema at the same time.On the other hand, adding the following code to the theme
functions.php
file will disable the Yoast SEO specificPerson
Schema:add_filter( 'wpseo_schema_person', '__return_false' );
I told you at the moment yoast is not generating any schema at all. Ive defaulted back to supplying my own schema.
And no we dont see these issues with googles structured data testing, GSDT only tests googles own structured data recommendations, we use a more advanced and more stringent structured data tool built into ScreamingFrog. And this says a URL is needed for type person.
So back to my original question, how can i edit the person schema in yoast?
Thanks though for specifying how to disable it if needed, might also come in handy in the future.
- This reply was modified 5 years, 5 months ago by Dean Williams.
You can use the
wpseo_schema_person
filter to modify thePerson
schema generated by Yoast SEO. Unfortunately, we are unable to provide an example of a custom code here.We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.
- The topic ‘edit the WPSEO_Schema_Person piece’ is closed to new replies.