Google for Jobs: only emit JobPosting JSON-LD for a real named employer
JobPosting requires a valid hiringOrganization; emitting «نامشخص / ثبت نشده» (the placeholder for aggregated ads with no named center) makes Google reject the posting and can flag invalid structured data across the site. Add SeoJsonLd.HasRealEmployer and gate the JobPosting/ShiftPosting <script> on it, so only listings with a genuine employer get marked up (those are the Jobs-eligible ones anyway). Improvement 3 of the backlog (SEO). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -216,6 +216,10 @@
|
||||
}
|
||||
|
||||
@section Head {
|
||||
@{ var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}"; }
|
||||
@Html.Raw("<script type=\"application/ld+json\">" + JobsMedical.Web.Services.SeoJsonLd.ShiftPosting(s, bu) + "</script>")
|
||||
@* Only for a real named employer — Google for Jobs rejects a placeholder hiringOrganization. *@
|
||||
@if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(f))
|
||||
{
|
||||
var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}";
|
||||
@Html.Raw("<script type=\"application/ld+json\">" + JobsMedical.Web.Services.SeoJsonLd.ShiftPosting(s, bu) + "</script>")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user