How I Fixed My Sitemap: [object Object] URLs Were Poisoning 5 Sites
The Bug I have 8 niche tool sites built with AI. Yesterday I found 5 of them had [object Object] and undefined in their sitemap XML. Root Cause // BAD: concatenating object instead of property const url
The Bug
I have 8 niche tool sites built with AI. Yesterday I found 5 of them had [object Object] and undefined in their sitemap XML.
Root Cause
// BAD: concatenating object instead of property
const url = `https://site.com/${page}`;
// = https://site.com/[object Object]
// GOOD:
const url = `https://site.com/${page.slug}`;
Check Yours
curl -s https://yoursite.com/sitemap.xml | grep -E "object Object|undefined|null"
Fixed all 8 sites. Full rebuild + redeploy. Now tracking at livephotokit.com.
📰 Read the original article on Dev.to AI
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.