Pergunta

I added a sitemap.xml file to my site (see Why is my sitemap file considered empty?), and google is saying the xml is invalid:

Warnings
Invalid XML: too many tags
Too many tags describing this tag. Please fix it and resubmit.
Issues count: 48
Examples: 
Line 16: Parent tag: url
Tag: loc

Line 17:
Parent tag: url
Tag: lastmod

Line 18:
Sep 16, 2013
Parent tag: url
Tag: changefreq

Here is the sitemap.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.awardwinnersonly.com</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>http://www.awardwinnersonly.com/getHugos.cshtml</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>.7</priority>
    <loc>http://www.awardwinnersonly.com/Content/pulitzers2.json</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>monthly</changefreq>
    <priority>.7</priority>
    <loc>http://www.awardwinnersonly.com/Content/nba.json</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>monthly"</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/NBCCJr.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/noba.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/grammies.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/indies.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/ama.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/cma.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/oscars.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/sundance.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/cannes.json</loc>
      <lastmod>20 13-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
      <loc>http://www.awardwinnersonly.com/Content/goldenglobes.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
    </url>
</urlset>
Foi útil?

Solução

You're missing your opening and closing <url></url> tags around most of your listings.

Outras dicas

There are several tools that can automatically generate sitemap.xml such as this Kohana module. This would assure us to avoid an invalid xml file from making it manually or due to an uploading problem.

Here is an example code to show how the sitemap.xml is generated on server:

// Sitemap instance.
$sitemap = new Sitemap;

//this is assume you put an array of all url in a cache named 'sitemap'
foreach($cache->get('sitemap') as $loc)
{
    // New basic sitemap.
    $url = new Sitemap_URL;

    // Set arguments.
    $url->set_loc($loc)
        ->set_last_mod(1276800492)
        ->set_change_frequency('daily')
        ->set_priority(1);

    // Add it to sitemap.
    $sitemap->add($url);
}

// Render the output.
$response = $sitemap->render();

// Cache the output for 24 hours.
$cache->set('sitemap', $response, 86400);

// Output the sitemap.
echo $response;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top