SEO Checks

Open to all! Ask other shopowners for help.
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

SEO Checks

Post by tessthepup »

I am just running through a few basic changes to try and improve on seo after running an online check and thought it would be good to start a topic on what I am doing to try and improve my score.

First of all meta title.

I see my meta title as
<title>nuVitamins</title>
I presume this title is being pulled in from admin>my store>store name

How/where do I add extra info that will not reflect anywhere else i.e.
<title>Health Supplements Online / Packed with Natural Ingredients | nuVitamins</title>
is there an admin setting I am failing to see or a language file that needs editing?


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: SEO Checks

Post by ecartz »

Line 32 of templates/default/includes/components/template_top.php:

Code: Select all

<title><?= htmlspecialchars($Template->get_title()) ?></title>
The default value for that is set by line 65 of includes/classes/application.php:

Code: Select all

      Guarantor::ensure_global('Template')->set_title(TITLE);
which leads to line 36 of includes/languages/english.php:

Code: Select all

const TITLE = STORE_NAME;
Beyond that, some pages set the title to custom values. E.g. the product info page, the index page for a category or manufacturer, or the specials page. This can be done by a header tag module. In the case of the specials page, it also requires defining META_SEO_TITLE in the page's language file.

Anyway, to answer your original question, edit the title in english.php to change it. It's set to the STORE_NAME for convenience. Replace it or add to it as you wish.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: SEO Checks

Post by heatherbell »

tessthepup wrote: Mon Mar 28, 2022 6:23 pm is there an admin setting I am failing to see or a language file that needs editing?
Meta SEO Title and Meta SEO Description for Product, Category and Manufacturer are defined when you edit them in admin>Catalog.
However, for pages such as index.php (which I think you are referring to) and specials.php, they are defined in their language files e.g. https://github.com/CE-PhoenixCart/Phoen ... ex.php#L25

Make sure you install
admin>Modules>Header Tags>
SEO Pages
Product SEO
Category SEO
Manufacturer SEO

So to answer your question, go to admin>Tools>Define languages>index.php
change

Code: Select all

define('META_SEO_TITLE', 'Index Page Title');
to

Code: Select all

define('META_SEO_TITLE', 'Health Supplements Online / Packed with Natural Ingredients');
Install admin>Modules>Header Tags>SEO Pages

META_SEO_TITLE will then be prepended to your STORE_NAME on your index.php page (also shown in the Chrome browser tab) exactly how you wanted i.e.
Health Supplements Online / Packed with Natural Ingredients | nuVitamins
See https://phoenixcart.org/phoenixcartwiki ... timisation
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: SEO Checks

Post by tessthepup »

Thank you to ecartz and heatherbell for the info.

After a few more changes of description I now have perfectly optimised meta title and meta description.

This evenings question is a 2 part one (ref attached image)

Part 1 - The Canonical URL

I presume this is because of the session id, is there anyway to get this to pass?

Part 2 - One or more of the specified languages are not ISO standard (en, en-us, de, etc.)

I only have the english language and have no idea actually what this means?
You do not have the required permissions to view the files attached to this post.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: SEO Checks

Post by ecartz »

tessthepup wrote: Tue Mar 29, 2022 6:27 pm I presume this is because of the session id, is there any way to get this to pass?
What are you using to generate the canonical link? I just tried installing the canonical header tag module on my test site, and it correctly generates the link without a session ID.
tessthepup wrote: Tue Mar 29, 2022 6:27 pm I only have the english language and have no idea actually what this means?
Perhaps it wants it set in the HTML_PARAMS, e.g. for German: https://github.com/cupidare/PhoenixCart ... an.php#L30

Code: Select all

const HTML_PARAMS = ' dir="ltr" lang="de"';
Don't forget to include a space at the beginning of the string. Also, you may want the language to be en-GB (rather than just en). For German, the language is de (i.e. de is the thing that you want to replace in that line).
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: SEO Checks

Post by tessthepup »

What are you using to generate the canonical link? I just tried installing the canonical header tag module on my test site, and it correctly generates the link without a session ID.
I was using the header tag module that came with the Ultimate SEO Urls addon, removed that and installed the stock one and it worked :)

Edit - I spoke to soon.

The SEO analysis says the link points to
and then this below
The specified canonical link points to a different page.
I think it might have something to do with .htaccess but not sure

Code: Select all

## BEGIN USU URL rewrite rules ##
## USU Version: 3.0.4 ##
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
  RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ info.php [NC,L,QSA]
  ## For rewrite, path_rewrite
  RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ ext/modules/content/reviews/write.php [NC,L,QSA]
  ## For standard, path_standard
  RewriteRule ^write.php/([a-z0-9/-]+)-pr-([0-9]+) ext/modules/content/reviews/write.php [NC,L,QSA]
</IfModule>
Perhaps it wants it set in the HTML_PARAMS, e.g. for German: https://github.com/cupidare/PhoenixCart ... an.php#L30

Code: Select all

const HTML_PARAMS = ' dir="ltr" lang="de"';
Don't forget to include a space at the beginning of the string. Also, you may want the language to be en-GB (rather than just en). For German, the language is de (i.e. de is the thing that you want to replace in that line).
Strange one this as my line was this

Code: Select all

const HTML_PARAMS = '';
changed it to

Code: Select all

const HTML_PARAMS = ' dir="ltr" lang="en"';
and it works, happy days.

on to the next task.............
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: SEO Checks

Post by heatherbell »

tessthepup wrote: Wed Mar 30, 2022 5:44 pmUltimate SEO Urls addon
Your choice but note that the addon has been unsupported for quite a while.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: SEO Checks

Post by ecartz »

You could try changing line 35 of ht_canonical.php from

Code: Select all

          return $GLOBALS['Linker']->build('index.php', [], false);
to

Code: Select all

          return $GLOBALS['Linker']->build('', [], false);
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: SEO Checks

Post by Omar_one »

heatherbell wrote: Thu Mar 31, 2022 6:51 am
tessthepup wrote: Wed Mar 30, 2022 5:44 pmUltimate SEO Urls addon
Your choice but note that the addon has been unsupported for quite a while.
hope someone will support it and update it
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: SEO Checks

Post by tessthepup »

ecartz wrote: Thu Mar 31, 2022 6:58 am You could try changing line 35 of ht_canonical.php from

Code: Select all

          return $GLOBALS['Linker']->build('index.php', [], false);
to

Code: Select all

          return $GLOBALS['Linker']->build('', [], false);
That did the trick, thank you


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply