# Schema Validation Fixes - ShiftOps


**Last Updated:** 2025-11-20

**Date:** 2025-11-20  
**Status:** ✅ Fixed  
**Validator:** https://validator.schema.org/#url=https%3A%2F%2Fwww.ordio.com%2Fshiftops

## Issues Found & Fixed

### 1. ✅ Duplicate FAQPage Schema

**Problem:** FAQPage was declared twice:

- Once in JSON-LD schema (line 217)
- Once in HTML microdata (line 1852)

**Error:** "Duplicate field 'FAQPage'"

**Fix:** Removed HTML microdata, kept JSON-LD only (preferred method)

**Changes:**

- Removed `itemscope itemtype="https://schema.org/FAQPage"` from `<section>` tag
- Removed `itemscope itemprop="mainEntity" itemtype="https://schema.org/Question"` from FAQ items
- Removed `itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer"` from answer divs
- Kept JSON-LD schema in `<script type="application/ld+json">` block

**Result:** Single FAQPage declaration in JSON-LD ✅

---

### 2. ✅ Invalid WebApplication Properties

**Problem:** Several properties not recognized by Schema.org:

#### 2.1 Geographic Area (Error)

- **Property:** `geographicArea` with `@type: Place`
- **Error:** "Place ist kein gültiger Zieltyp für die Eigenschaft geographicArea"
- **Fix:** Removed `geographicArea`, added `areaServed` with `Country` array instead

#### 2.2 Required Min Age (Warning)

- **Property:** `requiredMinAge` in `BusinessAudience`
- **Warning:** Not recognized for BusinessAudience type
- **Fix:** Removed (not a valid property)

#### 2.3 Audience Size (Error)

- **Property:** `audienceSize` with `QuantitativeValue`
- **Error:** Not recognized for BusinessAudience type
- **Fix:** Removed (not a valid property)

#### 2.4 Available Language (Warning)

- **Property:** `availableLanguage` with `Language` type
- **Warning:** Not recognized for WebApplication type
- **Fix:** Removed (already have `inLanguage` property)

**Changes Made:**

```json
// BEFORE (Invalid):
"audience": {
    "@type": "BusinessAudience",
    "audienceType": "...",
    "geographicArea": {
        "@type": "Place",
        "name": "Deutschland, Österreich, Schweiz"
    },
    "requiredMinAge": 18,
    "audienceSize": {
        "@type": "QuantitativeValue",
        "value": "50+"
    }
},
"availableLanguage": {
    "@type": "Language",
    "name": "German",
    "alternateName": "de"
}

// AFTER (Valid):
"audience": {
    "@type": "BusinessAudience",
    "audienceType": "Restaurant-Betreiber, Einzelhandel, Hotel-Manager, Schichtbetriebe"
},
"areaServed": [
    {
        "@type": "Country",
        "name": "Deutschland"
    },
    {
        "@type": "Country",
        "name": "Österreich"
    },
    {
        "@type": "Country",
        "name": "Schweiz"
    }
]
```

**Result:** All invalid properties removed, valid `areaServed` added ✅

---

### 3. ✅ Missing Text Property (Fixed by Removing Microdata)

**Problem:** Microdata answers were missing `itemprop="text"` on actual text content

**Fix:** Removed microdata entirely (using JSON-LD only), which has proper `text` properties

**Result:** All FAQ answers have proper `text` property in JSON-LD ✅

---

## Validation Results

### Before Fixes

- ❌ 2 Errors
- ⚠️ 2 Warnings
- 7 Elements detected

### After Fixes (Expected)

- ✅ 0 Errors
- ✅ 0 Warnings
- ✅ 7 Elements detected (all valid)

---

## Schema Types Validated

1. ✅ **WebPage** - Valid
2. ✅ **WebApplication** - Fixed (removed invalid properties)
3. ✅ **BreadcrumbList** - Valid
4. ✅ **FAQPage** - Fixed (removed duplicate microdata)
5. ✅ **HowTo** - Valid
6. ✅ **SiteNavigationElement** - Valid
7. ✅ **Organization** - Valid (from base includes)

---

## Files Modified

- `v2/pages/shiftops.php`
  - Lines 173-190: Fixed WebApplication audience and areaServed
  - Lines 1852-1875: Removed FAQPage microdata

---

## Testing

### Validation Tools

1. **Schema.org Validator:** https://validator.schema.org/#url=https%3A%2F%2Fwww.ordio.com%2Fshiftops
2. **Google Rich Results Test:** https://search.google.com/test/rich-results
3. **Google Search Console:** URL Inspection tool

### Expected Results

- ✅ No schema errors
- ✅ No schema warnings
- ✅ All 7 schema types valid
- ✅ FAQPage rich results eligible
- ✅ WebApplication properly structured

---

## Best Practices Applied

1. **Single Schema Declaration:** Use JSON-LD only, avoid mixing with microdata
2. **Valid Properties Only:** Only use properties recognized by Schema.org
3. **Proper Types:** Use correct types (Country instead of Place for areaServed)
4. **Complete Data:** Ensure all required properties are present (text in Answer)

---

## References

- [Schema.org WebApplication](https://schema.org/WebApplication)
- [Schema.org BusinessAudience](https://schema.org/BusinessAudience)
- [Schema.org FAQPage](https://schema.org/FAQPage)
- [Schema.org Validator](https://validator.schema.org/)

---

**Fixed:** November 19, 2025  
**Validated:** Pending re-validation after deployment  
**Status:** ✅ Ready for deployment
