Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Index meta tags


Chadka

Recommended Posts

I only want the index of my store to be indexed by search engines and disallow all other pages in the robots.txt. Is there a way for adding meta tags (description, keywords, robots) to the index.php without using head tag contribs?

 

Thanks!

Link to comment
Share on other sites

You can add them directly to the index.php file. However, since the index.php page is used for more than the home page, you would have to add some code to only include them if the home page is being displayed.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Chadka,

 

The proper way is adding them to header.php in catalog/includes/

 

In addition, you have diverse interesting contributions related to it, such as

 

http://www.oscommerce.com/community/contributions,207

 

and others.

 

Regards,

 

José Manuel Rosón Bravo

Link to comment
Share on other sites

You can add them directly to the index.php file. However, since the index.php page is used for more than the home page, you would have to add some code to only include them if the home page is being displayed.

Could that eventually result that more pages will be indexed than only the index page (main page) itself?

Which code would you recommend to use?

Link to comment
Share on other sites

Hi Chadka,

 

The proper way is adding them to header.php in catalog/includes/

 

In addition, you have diverse interesting contributions related to it, such as

 

http://www.oscommerce.com/community/contributions,207

 

and others.

 

Regards,

 

José Manuel Rosón Bravo

Okay, so I add code for meta tags only in the header.php and not index.php or do I need to add it to both of them? :huh:

Link to comment
Share on other sites

Could that eventually result that more pages will be indexed than only the index page (main page) itself?

Which code would you recommend to use?

If not coded correctly, you could end up adding tags to all of your categories and manufacturers. I don't recommend doing it this way since it really won't help much but if you want to do it, you would put something like this in the <head> section

if ($category_depth != 'nested' && $category_depth != 'products') {
...put your meta tags and title here
}

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Okay, so I add code for meta tags only in the header.php and not index.php or do I need to add it to both of them? :huh:

No, don't do that since it is incorrect. Titles and meta tags belong in the <head> section and you can't do that from the header.php file. Also, don't use the contribution mentioned. It has not been updated in years and will cause as many problems as it fixes. If you are going to install a contribution for this and you are serious about SEO'ing your site, then you should use Header Tags SEO. If you just want an easy way to control title and meta tags, then use one of the other meta tags contribuions. It doesn't really matter which since they all do the same thing. But either way, you really should install a contribution since doing it your way is almost useless as far as results are concerned.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

No, don't do that since it is incorrect. Titles and meta tags belong in the <head> section and you can't do that from the header.php file. Also, don't use the contribution mentioned. It has not been updated in years and will cause as many problems as it fixes. If you are going to install a contribution for this and you are serious about SEO'ing your site, then you should use Header Tags SEO. If you just want an easy way to control title and meta tags, then use one of the other meta tags contribuions. It doesn't really matter which since they all do the same thing. But either way, you really should install a contribution since doing it your way is almost useless as far as results are concerned.

Is it possible to only index the index page with the Header Tags SEO contribution and disallow all other pages and folders with a robots.txt? I have Ultimate SEO Urls Pro by FWR Media installed. Do you know if they are both compatible with each other?

Link to comment
Share on other sites

Is it possible to only index the index page with the Header Tags SEO contribution and disallow all other pages and folders with a robots.txt? I have Ultimate SEO Urls Pro by FWR Media installed. Do you know if they are both compatible with each other?

No, header Tags SEO can't do that. If a page isn't setup, it will build default titles and tags. SEO 5 will work with Header Tags SEO if you change one of its settings but if you are committed to limiting tags to the home page, then don't install Header Tags SEO. It would be very much overkill. I am not familiar with the other meta tags contributions so I can't say if they will work with only the home page or not. I have to ask, though, why do you not want the tags on the categories and products? That will only hurt your shop.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

No, header Tags SEO can't do that. If a page isn't setup, it will build default titles and tags. SEO 5 will work with Header Tags SEO if you change one of its settings but if you are committed to limiting tags to the home page, then don't install Header Tags SEO. It would be very much overkill. I am not familiar with the other meta tags contributions so I can't say if they will work with only the home page or not. I have to ask, though, why do you not want the tags on the categories and products? That will only hurt your shop.

Okay, I understand, but theoretically I could just exclude all other pages that I don't want to be indexed with a robots. txt no matter if I use the contrib or add the code manually!? I don't want the tags on the categories and products, because I've seen a lot of shops with 20-30 search results and even more for only the products and that's not what I want. I want to keep the search results clean and focused on only the main page, everything else seems to be unnecessary to me. I use this method an all other non-store pages as well and it works perfect for me.

Link to comment
Share on other sites

Okay, I understand, but theoretically I could just exclude all other pages that I don't want to be indexed with a robots. txt...

 

If your pages are already indexed, then adding them to robots.txt is not going to remove them from the index. You will have to add a meta noindex tag on those pages.

Link to comment
Share on other sites

Okay, I understand, but theoretically I could just exclude all other pages that I don't want to be indexed with a robots. txt no matter if I use the contrib or add the code manually!? I don't want the tags on the categories and products, because I've seen a lot of shops with 20-30 search results and even more for only the products and that's not what I want. I want to keep the search results clean and focused on only the main page, everything else seems to be unnecessary to me. I use this method an all other non-store pages as well and it works perfect for me.

So if you sell a very popular product, you are saying you don't want visitors to find it. I don't understand that reasoning but to each his own. You can exclude the files in the robots file, though that doesn't mean that google won't list them. Even if you add a no index tag, they may still list it. They just won't rank it which, again, defeats the purpose of having a shop, or so it seems to me.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

What do you think about using this code in the index.php after the </title> and before </head>?

 

<?php echo "<meta name=\"keywords\" content=\"".KEYWORDS."\">"; ?>

<?php echo "<meta name=\"description\" content=\"".DESCRIPTION."\">"; ?>

 

Can I use the instructions on this page? Link

Link to comment
Share on other sites

What do you think about using this code in the index.php after the </title> and before </head>?

 

<?php echo "<meta name=\"keywords\" content=\"".KEYWORDS."\">"; ?>

<?php echo "<meta name=\"description\" content=\"".DESCRIPTION."\">"; ?>

 

Can I use the instructions on this page? Link

No need to both with that. Since you only want them on the home page, you would just enter the code directly. No php needed other that what I've already posted to ensure only the home page is changed.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

No need to both with that. Since you only want them on the home page, you would just enter the code directly. No php needed other that what I've already posted to ensure only the home page is changed.

What does that code exactly do? Does it stop the products and categories from being visited/indexed or does it add the same meta infos to the products and categories as to the index page?

if ($category_depth != 'nested' && $category_depth != 'products') {

...put your meta tags and title here

}

 

So, the added code would look like that?

 

if ($category_depth != 'nested' && $category_depth != 'products') {

 

<meta name="title" content="my title">

<meta name="keywords" content="my keywords">

<meta name="description" content="my description">

<meta name="robots" content="index, nofollow">

 

}

 

I have a multilingual store. Do I need to add something to the /includes/languages .php files (english.php etc.)?

 

Thank you!

Link to comment
Share on other sites

What does that code exactly do? Does it stop the products and categories from being visited/indexed or does it add the same meta infos to the products and categories as to the index page?

if ($category_depth != 'nested' && $category_depth != 'products') {

...put your meta tags and title here

}

 

So, the added code would look like that?

 

if ($category_depth != 'nested' && $category_depth != 'products') {

 

<meta name="title" content="my title">

<meta name="keywords" content="my keywords">

<meta name="description" content="my description">

<meta name="robots" content="index, nofollow">

 

}

 

I have a multilingual store. Do I need to add something to the /includes/languages .php files (english.php etc.)?

 

Thank you!

The code allows the title and tags to show only on the home page.

 

The actual code should be

<?php if ($category_depth != 'nested' && $category_depth != 'products') { ?>

[b]<meta name="title" content="my title">
<meta name="keywords" content="my keywords">
<meta name="description" content="my description">
<meta name="robots" content="index, nofollow">[/b]

<?php }?>

 

For each condition you add, like different languages, you get closer and closer to a contribution. The code for what you want to do is in most, if not all, of the meta tags contributions so you should look there for futher coding help. You'll need to do that since you will probably keep running into problems with the way you are going about it.

Support Links:

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

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The code allows the title and tags to show only on the home page.

 

The actual code should be

<?php if ($category_depth != 'nested' && $category_depth != 'products') { ?>

[b]<meta name="title" content="my title">
<meta name="keywords" content="my keywords">
<meta name="description" content="my description">
<meta name="robots" content="index, nofollow">[/b]

<?php }?>

 

For each condition you add, like different languages, you get closer and closer to a contribution. The code for what you want to do is in most, if not all, of the meta tags contributions so you should look there for futher coding help. You'll need to do that since you will probably keep running into problems with the way you are going about it.

I have the same descriptions and keywords for each language. Should I add code to only the main default language file? I want to avoid that all main language pages will be indexed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...