Google Schema Bug:邮编2135返回郊区错误(Petersham替代Strathfield)
Hey folks, let's work through fixing this Google Schema bug where entering postcode 2135 returns "Petersham" instead of the correct suburb "Strathfield". Here are practical, actionable steps to resolve this:
Validate and Update Your Core Address Data
Start by cross-referencing your postcode-suburb mappings against official local postal records (for this AU postcode, that's Australia Post). If you're using an internal database or hardcoded values, fix any entries that incorrectly link 2135 to Petersham. Double-check edge cases—sometimes postcodes overlap with suburb boundaries, so ensure your data reflects the official primary suburb for 2135.Refine Your Schema Generation Logic
Dig into the code that generates your Schema markup. It's likely there's a range-based condition that's accidentally including 2135 in Petersham's postcode range. For example, if you have logic like "postcodes 2130-2135 = Petersham", you'll need to split that range to exclude 2135. Here's a quick example of fixing this in JavaScript:// Buggy logic that catches 2135 incorrectly function getSuburbFromPostcode(postcode) { if (postcode >= 2130 && postcode <= 2135) { return "Petersham"; } // ... other mappings } // Fixed logic prioritizing the correct suburb for 2135 function getSuburbFromPostcode(postcode) { if (postcode === 2135) { return "Strathfield"; } else if (postcode >= 2130 && postcode <= 2134) { return "Petersham"; } // ... other mappings }Switch to Dynamic Geocoding for Reliability
If you're generating Schema dynamically, consider using a trusted geocoding API to fetch the correct suburb for a given postcode. This eliminates manual mapping errors and ensures your data stays aligned with official postal updates. Just remember to cache frequent lookups to keep performance snappy.Validate Changes with Google's Tools
After making updates, use Google's Rich Results Test tool to verify your Schema. Input the postcode 2135 and confirm theaddressLocalityfield now shows "Strathfield". Don't stop there—test adjacent postcodes too to make sure you haven't broken other suburb mappings.Report the Bug to Google (if it's native parsing)
If this issue is happening when Google automatically generates Schema from your content (not your custom markup), submit a detailed bug report via Google Search Console. Include: postcode 2135, incorrect suburb "Petersham", correct suburb "Strathfield", and a link to the page where the bug appears. This helps Google fix their internal mapping data.
内容的提问来源于stack exchange,提问作者DanOffer

