Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google XML Sitemap SEO


Jack_mcs

Recommended Posts

A site can run without it but it does help. When you run the script for this addon, it tells you what to add to your robots file. For the contents of the file, there are many tutorials on the web and there are examples in these forums. Or you can just visit a site and look at what they use. Here's mine. One very important point though is that you should not include your admin directory in the file. Hackers use the file to get information about a site so including the admin name helps them.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

I'm using v1.9. The sitemaps I've turned in to Google and the others are correct as far as I can tell. Near all page links that are not truncated on Google such as categories, products, etc. have "Customer Service" at the end. Just curious as to why. It doesn't show that way in the sitemaps. But it's showing up that way after being indexed. I thought maybe the Customer Service block in the footer may have something to do with it so I removed it. But I'm not sure which links were indexed before or after I remove the Customer Service block. It seems that it is still being indexed that way. I looked in my Google Webmasters, Google Analytics and Bing Webmasters and nothing appears with Customer Service so that's why I'm confused.

Take care
Bill

Link to comment
Share on other sites

There isn't anything in the code to add "customer service" to each link. Maybe you enabled that feature in your google account?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Your answer makes sense. I checked to see if I enabled that feature in my google account. It appears it is not but, I'd bet it's something similar to that within Google. I'll keep searching until I find the cause. I didn't think it was your add-on because all seemed fine with the sitemaps but I had to ask since the answer wasn't obvious.

 

By the way, I love your add-on, it works beautifully. I especially like the fact that I can use it with a cron job.

 

Take care

Bill

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I installed Google XML Sitemap SEO V 1.9 on my OSC 2.3.4

 

Easy install but how to run it, files uploaded, SQL run correctly, and addon activated from admin configuration.

 

Now, as per the readme file, i should browse http://YOUR_DOMAIN/googlesitemap/index.php, a page openned including the installation instruction. See attached img.

 

 

post-244988-0-30179300-1484225226_thumb.jpg

Link to comment
Share on other sites

Something in your account is preventing the index.php from loading. Rename it to something else and then use the url with that new name.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

i changed the name of index.html it worked. Thank you :)

 

now i have many generated sitemap xml files, for manufacturer, special and others.. which one should insert in google webmaster tools ? img attached

post-244988-0-37059700-1484230092_thumb.jpg

Edited by Psytanium
Link to comment
Share on other sites

@@Psytanium

 

The sitemapindex.xml list all of the other sitemaps so that is what is recommended to be turned into google and the other search engines.

 

Also, you should point to it in your robots.txt file as well.

 

For http protocol:

sitemap: http://your-domain-name.com/sitemapindex.xml

 

For https protocol:

sitemap: https://your-domain-name.com/sitemapindex.xml

 

Take care

Bill

Link to comment
Share on other sites

@@Psytanium William is correct about the sitemapindex.xml being the only one you need to add. However, if there are errors, they are not easily found just with it. For that reason, I suggest adding all of the ones you want to use. If errors occur, they will show in those files. Also, google will show how many of the links are listed. This isn't anything you use but it is nice to see that they are working on the site.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

@@Denzel @@Jack_mcs

 

Hi Jack,

 

Having trouble installing this on my BS Edge site php 7. Got 500 error at googlesitemap/index.php with default settings. So i went through the index.php file and sitemap.class.php and made all the usual changes. Hard coded paths and changed class construct, changed mysql to mysqli and commented out require for filenames but nothing seems to work. I've tried disabling seo urls in case that was causing an issue but didn't change anything. Unfortunately because it's giving 500 error i've got nothing to work off in diagnostics or error log.

 

Can you offer any advice as to what might be causing the issue?

 

Denzel it seems you got this working on edge. Can you elaborate on any other changes you had to make than the ones i've mentioned above to get it working?

Link to comment
Share on other sites

@@annuity I don't know why it is failing but I can say it isn't because of Edge being used since I've installed into several of those without any problems. I'm guessing it is because of the php 7 you are using. I haven't tried it with that but there is a thread on the forums about Edge not working with php 7. I haven't followed it so I don't know if the problems were resolved but you may want to look there.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...

Hi Jack,

 

It seems I'm addicted to your work... ^_^'

 

I have installed the latest version 1.9 of your updated script and I have noticed that for ONLY category URL paths, specials caracters are missing and each line is duplicated like this :

http://www.xxx.com/consoles-de-salon-xbox-360-pices-dtaches-c-124_4_30.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-xbox-360-pices-dtaches-c-124_4_30.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-xbox-360-rparation-c-124_4_31.html	        2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-xbox-360-rparation-c-124_4_31.html	        2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-consoles-c-124_5_32.html	        2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-consoles-c-124_5_32.html	        2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-dveloppement-c-124_5_33.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-dveloppement-c-124_5_33.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-installation-c-124_5_34.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-installation-c-124_5_34.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-accessoires-c-124_5_35.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-accessoires-c-124_5_35.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-pices-dtaches-c-124_5_36.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-pices-dtaches-c-124_5_36.html	2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-rparation-c-124_5_37.html        2016-08-08	weekly	0.5
http://www.xxx.com/consoles-de-salon-wii-wii-u-rparation-c-124_5_37.html        2016-08-08      weekly  0.5

Product listing is ok...

 

Do you know a fix for this ?

 

Thanks !

 

I have the same issues.

 

I'm upgrading from v1.2 to v1.9 and I have duplicate categories and missing specials characters.

 

Specials characters don't work in v1.2 (and I'm using your USU).

 

Duplicate categories begin on v1.5, before version don't duplicate.

 

EDITED:

 

Using this sql query on phpmyadmin:

 

 

        $sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod

                FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id  

          " . $quotes . "

                ORDER BY c.parent_id ASC, c.sort_order ASC, c.categories_id ASC";

 

And adding cd.language_id, shows why are duplicating categories.

 

I have spanish and english, but both urls are show in spanish instead of one in spanish and other in english.

 

Thanks in advance

Edited by PiLLaO
Link to comment
Share on other sites

I still don't know what might be causing the duplicate links since I can't reproduce the problem. I compared the two versions you mentioned but don't see anything that would cause this. For the languages, the code checks the language that is used when the script is ran and uses it. You would need to change the language and rerun the script to get links for the other language. I don't see how you are seeing both now. But if you did that it would replace the sitemap files so you would not gain anything.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@PiLLaO

For Mysql5.7 with the hard sql_mode this will not work.

$sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod
                FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id  
          " . $quotes . "
                ORDER BY c.parent_id ASC, c.sort_order ASC, c.categories_id ASC";

Change to this:

$sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod, c.parent_id, c.sort_order
                FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id  
          " . $quotes . "
                ORDER BY c.parent_id, c.sort_order, c.categories_id ASC";

This is Mysql5.7 suitable.

Edited by mcmannehan
  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Link to comment
Share on other sites

Hi

 

Sadly the sitemap isn't picking up the SEO friendly URLs add-on I have installed, which is http://addons.oscommerce.com/info/9371. The Product URL is still showing as  https://domain.com/product_info.php?products_id=39.

 

Any ideas how I can get the SEO friendly URLs to be included on the site map?

 

Many thanks

 

Glen

Link to comment
Share on other sites

@@Jack_mcs @@mcmannehan Thanks both to answer me :)

 

I solved duplicated categories link making this:

 

googlesitemap/index.php

 

find:

   if ($google->GenerateCategorySitemap()){
    if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'Generated Google Category Sitemap Successfully' . "\n\n";
   } else {

replace with:

   if ($google->GenerateCategorySitemap($languages_id)){
    if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'Generated Google Category Sitemap Successfully' . "\n\n";
   } else {

and in googlesitemap/sitemap.class.php

 

find:

	function GenerateCategorySitemap(){
        $quotes = (defined('QUOTES_CATEGORY_NAME') ? " where cd.categories_name NOT LIKE '" . QUOTES_CATEGORY_NAME . "' " : '');
		$sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod 
			    FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id  
          " . $quotes . "
				ORDER BY c.parent_id ASC, c.sort_order ASC, c.categories_id ASC";

and replace with:

	function GenerateCategorySitemap($languages_id){
        $quotes = (defined('QUOTES_CATEGORY_NAME') ? " AND cd.categories_name NOT LIKE '" . QUOTES_CATEGORY_NAME . "' " : '');
		$sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod 
			    FROM " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id  
			    WHERE cd.language_id = " . (int)$languages_id . "
          " . $quotes . "
				ORDER BY c.parent_id ASC, c.sort_order ASC, c.categories_id ASC";

I don't find why don't replace specials characters like ó,í... because I have "specials characters conversion" in Ultimate Seo Urls, and in other links on the web the specials characters are changed correctly.

 

Best regards :)

Edited by PiLLaO
Link to comment
Share on other sites

This addon uses the Ultimate SEO code if it is present. So if the urls are correct in the shop, they should be correct in the map files. You may want to make sure you are using the latest version of each. Other than that, I don't know what it might be.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I fixed the missed specials characters making this:

 

in catalog/googlesitemap/index.php

 

Find:

 define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);

	require_once('includes/configure.php');
	require_once(DIR_WS_INCLUDES . 'filenames.php');
	require_once(DIR_WS_INCLUDES . 'database_tables.php');
	require_once(DIR_WS_FUNCTIONS . 'database.php');
	tep_db_connect() or die('Unable to connect to database server!');

	$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
	while ($configuration = tep_db_fetch_array($configuration_query)) {
		define($configuration['cfgKey'], $configuration['cfgValue']);
	}

	function tep_not_null($value) {
		if (is_array($value)) {
		  if (sizeof($value) > 0) {
			return true;
		  } else {
			return false;
		  }
		} else {
		  if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) {
			return true;
		  } else {
			return false;
		  }
		}
	} # end function

	include_once(DIR_WS_CLASSES . 'language.php');
	$lng = new language();
	$languages_id = $lng->language['id'];
 
  
if ( defined('SEO_URLS') && SEO_URLS == 'true' || defined('SEO_ENABLED') && SEO_ENABLED == 'true' ) {

	function tep_session_is_registered( $var ){
		return false;
	}  # end function

	function tep_session_name(){
		return false;
	} # end function
	
	function tep_session_id(){
		return false;
	} # end function

	function tep_parse_input_field_data($data, $parse) {
		return strtr(trim($data), $parse);
	} # end function

	function tep_output_string($string, $translate = false, $protected = false) {
		if ($protected == true) {
		  return htmlspecialchars($string);
		} else {
		  if ($translate == false) {
	    		return tep_parse_input_field_data($string, array('"' => '"'));
		  } else {
	    		return tep_parse_input_field_data($string, $translate);
		  }
		}
	} # end function

	
	if ( file_exists(DIR_WS_CLASSES . 'seo.class.php') ){
    if (! defined("tep_get_parent_categories"))
    {
      function tep_get_parent_categories(&$categories, $categories_id) {
        $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'");
        while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
          if ($parent_categories['parent_id'] == 0) return true;
          $categories[sizeof($categories)] = $parent_categories['parent_id'];
          if ($parent_categories['parent_id'] != $categories_id) {
            tep_get_parent_categories($categories, $parent_categories['parent_id']);
          }
        }
      }
    }
    require_once(DIR_WS_CLASSES . 'seo.class.php');
    $seo_urls = new SEO_URL($languages_id);
	}

	require_once(DIR_WS_FUNCTIONS . 'html_output.php');
	
	if ( file_exists(DIR_WS_CLASSES . 'cache.class.php') ){
		include(DIR_WS_CLASSES . 'cache.class.php');
		$cache = new cache($languages_id);
		if ( file_exists('includes/seo_cache.php') ){
			include('includes/seo_cache.php');
		}
		$cache->get_cache('GLOBAL');
	}
} # end if

Replace with:

  require('includes/application_top.php');

Now the urls shows correctly the missing characters.

 

But.... now I have a problem with SSL, if you use a HTTPS need to change this:

$domainArray[] = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

by this:

$domainArray[] = HTTPS_SERVER . DIR_WS_HTTP_CATALOG;

And comment all the href="gss.xsl" in sitemap.class.php because if you don't comment, your website "don't be secure" while you are showing urls without https.

 

That's all.

Best regards :)

 

 

Link to comment
Share on other sites

A new version has been uploaded with these changes:

 

  • Added an option so that the script can be ran manually in cases where cron jobs are not possible.
  • Added an option to prevent access to the sitemap script except by the entered IP.
  • Added code to ping Bing.
  • Changed the google ping url to use https.
  • Changed the messages when the script is ran manually to make usage more clear.
  • Corrected code by adding a missing dot in the file creation section. Found by member Denzel.
  • Removed the enable mobile setting since it was redundant.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Jack I just updated to the latest version and all seemed to go well with the update. I did notice that on creating the new site maps the page returned the following errors at the top

Notice: Use of undefined constant DIR_WS_HTTP_CATALOG - assumed 'DIR_WS_HTTP_CATALOG' in /home/railway1/public_html/googlesitemap/index.php on line 33

Notice: Constant GOOGLE_XML_SITEMAP_CREATE_TOPICS already defined in /home/railway1/public_html/googlesitemap/index.php on line 43

Notice: Constant GOOGLE_XML_SITEMAP_MANUAL_IP already defined in /home/railway1/public_html/googlesitemap/index.php on line 43

There is also two entries for Manual IP in the configuration page which look identical. Cant understand why as there is only one entry in the sql file.

 

Also after running the sql file there was this warning at the top of the page

This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

Apart from that all seems to be working fine with new sitemap files created.

Edited by 14steve14

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...