Jump to content

Google Sitemap module write homepage 2 times with different priorities


Recommended Posts

Hi,

 

I realise Google Sitemap module write homepage 2 times with 2 different prorities.

 

The version that I'm using is Google sitemap v3.2.0

 

I can edit it manually in XML file but that means I can't use Cron Task to update it automatically (unless I want to edit it every single time manually just to remove that duplication).

 

How can I fix it? Or is there a better XML module than the default one?

 

I thank you in advance.

Edited by Ben90 (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Hi,

 

to resolve this issue.

on the Configuration page of Google Sitemap module, 

there is this option:

 

Indicate the pages that you do not want to include in your Sitemaps file:

 

tick the Index 

 

and then re-generate it, you will see just one homepage (Index) entry on the sitemap file

 

HTH

 

Indicate the pages that you do not want to include in your Sitemaps file:

Link to comment
Share on other sites

Hi,

 

I have the same issue but tick the index is not the solution.

 

Thanks for the solution.

 

I have another issue, the category ID 2 (home) is write on the sitemap but it's a html 404...

How to delete this link from the sitemap ?

 

A solution is to override the gsitemap module and exclude the category ID 2 but i want to find a better solution.

 

Best regards

Edited by mistify34 (see edit history)
Link to comment
Share on other sites

  • 11 months later...
  • 3 months later...

Hi,

I have the same problem! It doesn't matter whether I select or deselect the index in the google sitemap module, I keep getting a /2-home url in my sitemap.

Also I noticed I have double entries for some url friendly links.
One exists and the other doesn't:
<url><loc>https://www.mywebsite.nl/12-friendly url</loc><priority>0.8</priority><lastmod>2015-07-04T13:19:36+02:00</lastmod><changefreq>daily</changefreq></url>
<url><loc>https://www.mywebsite.nl/28-friendly url</loc><priority>0.8</priority><lastmod>2015-10-31T11:44:06+01:00</lastmod><changefreq>daily</changefreq></url>

The /2-home url results in a 404 page. The /12-friendly url gives an empty page with no products.

Did somebody already found a solutions? I get index errors from Google Search Console.

BR
Frank

Link to comment
Share on other sites

  • 3 months later...
8 hours ago, bellini13 said:

For both of you....

Perhaps the question to ask is why do you have a home category as ID 2.  Did you attempt to create a new home category?

 

No I did not. Some how generating the sitemap gives you a double home category. Any clues where to look? 

Link to comment
Share on other sites

Or do you have a Home category with ID 2, and that is why you are getting the errant sitemap?

Since we are talking about Categories, you might start with confirming what your Categories look like and what is the ID of the Home category.

Link to comment
Share on other sites

On 14-6-2018 at 12:52 PM, bellini13 said:

Or do you have a Home category with ID 2, and that is why you are getting the errant sitemap?

Since we are talking about Categories, you might start with confirming what your Categories look like and what is the ID of the Home category.

I didn't create any home category.

Anyway, I managed to get rid of this id 2 home page by changing gsitemap.php in the gsitemap module folder.

Somewhere around line 440:

        foreach ($categories_id as $category_id)
        {
                        //remove 2-Home category link from sitemap, because the link gives 404 error                                         
                        if((int)$category_id['id_category'] == 2)   // id = 2 is Home category
                        {                            
                            continue;
                        }
            $category = new Category((int)$category_id['id_category'], (int)$lang['id_lang']);
            $url = $link->getCategoryLink($category, urlencode($category->link_rewrite), (int)$lang['id_lang']);

  • Thanks 2
Link to comment
Share on other sites

19 hours ago, bellini13 said:

Thats not what I asked you.  Is it that difficult to visit the Category page in your back office, and confirm what the Home category ID is?

 

I did look at the categories. But there isn't any. And since I made the changes to gsitemap.php in the gsitemap module folder the sitemap does not show any home category anymore. For me this is solved.

Link to comment
Share on other sites

On 6/23/2018 at 3:47 AM, Frankie M said:

 

I did look at the categories. But there isn't any. And since I made the changes to gsitemap.php in the gsitemap module folder the sitemap does not show any home category anymore. For me this is solved.

That makes no sense.  You looked at your categories and you have none? 

Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks later...

Same thing here, Presta 1.6.1.18, Google sitemap v3.2.1, Categories with IDs: 12, 36, etc... none with an ID of 2... But! Checking my DB, there's something interesting:

ps_category_shop

image.png.5e8724ca85efeb74466a2cc467e6e655.png

There is a category with ID 2...

Some more digging inside ps_category_lang

image.thumb.png.5246c1fdf787e6045048ff9c7af8a777.png

And then this is ps_category

image.thumb.png.0b8ca5b2a99797a1ac0a8efc6b42ec6a.png

 

I dont get this

Link to comment
Share on other sites

  • 1 year later...
On 6/18/2018 at 7:02 AM, Frankie M said:

I didn't create any home category.

Anyway, I managed to get rid of this id 2 home page by changing gsitemap.php in the gsitemap module folder.

Somewhere around line 440:

        foreach ($categories_id as $category_id)
        {
                        //remove 2-Home category link from sitemap, because the link gives 404 error                                         
                        if((int)$category_id['id_category'] == 2)   // id = 2 is Home category
                        {                            
                            continue;
                        }
            $category = new Category((int)$category_id['id_category'], (int)$lang['id_lang']);
            $url = $link->getCategoryLink($category, urlencode($category->link_rewrite), (int)$lang['id_lang']);

This worked for me. Thanks!

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...