Jump to content
Jack_mcs

Google XML Sitemap SEO

Recommended Posts

You should set up a cron job to run the script if you haven't.

 

i don't know how to do that... :blush: :sweating:

 

I don't get any errors never have. If a cron job (what ever that is) can automate the process that would be awesome.

 

UPDATE:

 

Just figured it out. A bit of research can do wonders...lol

Setting up cron job now...

 

Thanks Jack.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Hi Jack

 

It seems like the cron Job failed. Getting the following e-mail.

 

 

/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 1: ?php: No such file or directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 2: /bin: is a directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 3: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 4: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 5: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 6: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 7: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 8: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 9: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 10: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 11: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 12: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 13: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 14: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 15: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 16: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 17: product Imgs: command not found
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 18: product Imgs/: is a directory
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 20: syntax error near unexpected token `'../''
/home/xxxxx/xxxxxx/public_html/googlesitemap/index.php: line 20: `    chdir('../');'

 

What went wrong? osC Version is 2.3.3.4. Permission to the googlesitemap folder is 755

Edited by Tsimi

Share this post


Link to post
Share on other sites

For your problem, it appears something is wrong with the file. I had a problem on a site a while back where the cron job would run and It was due to a conflict with the name because of a redirect in the shops code. I renamed the googlesitemap/index.php file to gs_index.php and then changed the cron job to call that file. Give that a try and see if it helps.

 

By the way, I just realized the instructions don't mention setting up a cron job so I can see where that would confuse people. I'll add that to the next version.

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

 

I renamed the googlesitemap/index.php file to gs_index.php and then changed the cron job to call that file. Give that a try and see if it helps.

 

Thanks Jack will do and report back asap.

 

 

 

By the way, I just realized the instructions don't mention setting up a cron job so I can see where that would confuse people. I'll add that to the next version.

 

that is a good idea. :thumbsup:

Edited by Tsimi

Share this post


Link to post
Share on other sites

I am attempting to add this contribution.  When I ran the sql I received this error

 

#1048 - Column 'set_function' cannot be null

 

But, when I go to the admin all the options seem to be there.  Do I need to change anything?

Edited by dhooper

Diana

Share this post


Link to post
Share on other sites

Please look at the settings and see if there is one named "Exclude these pages." That is probably the one that caused the failure so it may not have been added.

Share this post


Link to post
Share on other sites

Try running this and see if it works:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function)
 VALUES ('Exclude these pages', 'GOOGLE_XML_SITEMAP_EXCLUDE_PAGES', '', 'Add these pages to the built-in file exclude list. This will prevent the links from being added to the pages site map.', '289', '20', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now(), NULL);

Share this post


Link to post
Share on other sites

Yes, that worked! :)  Now, how do I add pages to exclude?  It only has a true/false setting.  I want to exclude conditions, privacy, password reset, and a few custom ones that I've created.


Diana

Share this post


Link to post
Share on other sites

Never mind... I found where to add the files in sitemap.class  Thanks a bunch!  :)


Diana

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Got new e-mails and it seems that it failed again. Same messages as before.

Renamed the index.php and also adjusted the path for the cron job with same result.

Don't know exactly why that is happening but i guess i'll switch back to manual update mode.

I don't have that many new products on a regular basis so it's OK.

Share this post


Link to post
Share on other sites

The correct syntax for the above database problem us below, in case anyone else has this problem:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) 
 VALUES ('Exclude these pages', 'GOOGLE_XML_SITEMAP_EXCLUDE_PAGES', '', 'Add these pages to the built-in file exclude list. This will prevent the links from being added to the pages site map.', '289', '20', now());

Share this post


Link to post
Share on other sites

@@Tsimi The problem has something to do with your server so I can't help with that.

Share this post


Link to post
Share on other sites

@@Jack_mcs - first, thank you for the contribution!

 

Sorry if the question was asked and answered before, but does this module support catalogs with over 50,000 products? Does it auto-generate additional sitemap files as required? Does it make sure the total file size of each sitemap is under 10mb?

Share this post


Link to post
Share on other sites

@dr_lucas I haven't looked at that part of the code in a while. I know it definitely creates multiple map files if the number of products is over 50,000. I don't recall it checking for file size but the limit is 50 MB, not 10 MB: see here. I suppose it is possible for a file to reach that large but I've not seen it yet.

Share this post


Link to post
Share on other sites

Thanks, Jack. It seems google size limit is different than the standard, which is 10mb, and if we want sitemaps that can be read by all search spiders, it would be better to make the code check for that limit and create a new sitemap if reach the 10mb.

More details here: https://productforums.google.com/forum/#!topic/webmasters/nd5RDhMMfhk

Share this post


Link to post
Share on other sites

Good point. Even though I deal with SEO all the time, I still fall into the trap of thinking of things in relation to google.

 

But I'm still wondering if even 10 MB would be reached. Have you tested this on a site that would create multiple files?

Share this post


Link to post
Share on other sites

@@Jack_mcs

Yes, I did on my own site and it generated only 1 file of 50,000 products (out of the 90,000 I have). The file size was 12MB.

I have an older version (1.2) so that is possibly the reason it did not generate the consecutive file, but still - 12MB form 50,000 products is larger than the allowed standard.

Share this post


Link to post
Share on other sites

Correction, it seems all the version files show the same version 1.2, so I believe mine maybe a newer one - 1.4 or 1.5, if that makes any difference.

Share this post


Link to post
Share on other sites

The option to create more than one file once the 50,000 limit was reached has been part of the addon since it was released. There's only one spot in the file where 50000 is mentioned. I just changed that to 50 for a site I have here and six product maps files were created so the code is working correctly. If you troubleshoot it, please keep in mind that there are two files, sitemap.class.php and sitemap.class_Alternate.php, so be sure to edit the correct one, which is determined by the first setting of this addon.

Share this post


Link to post
Share on other sites

I assume you mean the pages site map since that is what the setting in admin is for. In that case, it should be any page that shouldn't be listed in the search engines. There is an internal list that blocks the obvious ones, like the checkout pages. But there may be a page specific to your site that you don't want listed. The best thing to do is to create the pages map file and then go through it to see if there are any that shouldn't be. In general, any page that requires a login should not be listed.

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

 

- Updated the sitemap schemas.
- Added an image sitemap.
- Added a mobile sitemap.
- Changed the input box for excluding pages for the pages map to make it easier to see.
- Fixed some coding mistakes that caused Article Manager topics not to be displayed correctly.
- Removed the alternate sitemap option.
- Changed the output when the script is ran manually.

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

2.3.4 standard, your new version 1.8. I do not have iOSC installed, 

 

I'm getting full failure for every type, like

Save Path /
WS_CAT    /
ERROR: Google Product Sitemap Generation FAILED!

 

The queries work fine

 

The next section like -

            [0] => Array
                (
                    [file] => /sitemapproducts.xml
                    [status] => failure
                    [file_exists] => false

 

sitemap.class.php, If I replace this:


		if (($pos = strpos(DIR_FS_CATALOG, "googlesitemap")) !== FALSE) { //fix for when path is gotten by dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'
                    $pos = strlen("googlesitemap");                               //it includes the google sitemap directory so remove it
		    $this->savepath = substr(DIR_FS_CATALOG, 0, - $pos - 1);      //not returning right above - quick fix for now
  		  $this->savepath .= (substr($this->savepath, -1) !== '/') ? '/' : ''; //append a slash if needed
		} else {
	  	  $this->savepath = DIR_FS_CATALOG . (substr(DIR_FS_CATALOG, -1) !== '/') ? '/' : '';
                }
                $this->base_url = $domain_name;

reverting back to this, everything completes successfully - but I haven't tested further

		
		$this->savepath = DIR_FS_CATALOG;
		$this->base_url = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

Also,

I have Enable mobile Map set to False, yet the generated sitemapindex.xml file is containing the mobile entries, such as

	<sitemap>
		<loc>http://www.mydomain.com/sitemap_mobileproducts.xml</loc>
		<lastmod>2015-03-15</lastmod>
	</sitemap>

Last,

Since my site is responsive, my mobile links are the same as the normal links. So should I put my standard domain in the "Mobile URL" field and enable mobile xml maps?

 

Thank you for the support!

Edited by Roaddoctor

-Dave

Share this post


Link to post
Share on other sites

That first error is probably due to how the DIR_FS_CATALOG is setup in the includes/configure.php file. Is yours set to the actual path (recommended) or it use some php function? The change you made is fine, though, for future releases, I would like to get it fixed.

 

For the mobile maps, the "Enable Mobile Map" is not used. It was used in my first version of this but later removed. Instead, the mobile url setting determines if the mobile maps are created or not. Leave it blank if you do not want mobile maps to be created. Otherwise, put the full url for your shop there. I needed to do it this way to make the code compatible with all possible mobile url's.  I apologize for the mistakes and poor instructions .

Share this post


Link to post
Share on other sites

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

×