New pages created by copying original page such as about_us.php SEO help

Open to all! Ask other shopowners for help.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

On my older current site running phoenix 1.0.7.11 in the language files of all the pages such as conditions, privacy and many others that I have created by copying and renaming other files have at the top of the language files the following

Code: Select all

define('META_SEO_TITLE', 'Entered text for page SEO title');
define('META_SEO_DESCRIPTION', 'Entered text for page SEO description');
I think at the time that was the code to get the title and description on the page of SEO.

I am now noticing in my server logs lots of errors telling me that META_SEO_TITLE and META_SEO_DESCRIPTION are already defined in other files. Which is expected as the same text appears in all language files for those pages.

I have tried changing 'META_SEO_TITLE to META_SEO_TITLE_ABOUT_US but it no longer shows on the About Us page when viewing source files in browser. It is also the same for any others that I alter. When I alter the files the errors obviously go away and no new ones seem to be present.

What needs doing to make the title and description show in every page in the older versions of phoenix. I don't really want to change to using the built in new page builder as when I tried that there was no sensible page title in the urls. I have lots of pages already listed on search engines that seem to be working fine and drawing in customers.

Any help appreciated.


Join The Code Co-op to get access to your library in the Code Co-op Forum
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

I believe that this is something to also do with the header tag module ht_pages_seo.php but have no idea what to change to get it to work with difference named META_SEO_TITLE and META_SEO_DESCRIPTION without getting all the Constant already defined warnings.

I should have added that without the two tags in the language files when viewing the source code of the page all I get is <title>Business name</title>rather than<title>About Business name | Business name</title>

With no seo description I get no text in the <meta name="description" content=" Business about us page description" />
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by heatherbell »

14Steve14 wrote: Tue Sep 06, 2022 9:12 am I think at the time that was the code to get the title and description on the page of SEO.
Looking at Gitgub repo, it still works that way, e.g. on v1.0.8.18
https://github.com/CE-PhoenixCart/Phoen ... hp#L25-L26
https://github.com/CE-PhoenixCart/Phoen ... hp#L19-L20

Have no answer to the notices you see but none show on a clean install.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

heatherbell wrote: Wed Sep 07, 2022 7:24 am
14Steve14 wrote: Tue Sep 06, 2022 9:12 am I think at the time that was the code to get the title and description on the page of SEO.
Looking at Gitgub repo, it still works that way, e.g. on v1.0.8.18
https://github.com/CE-PhoenixCart/Phoen ... hp#L25-L26
https://github.com/CE-PhoenixCart/Phoen ... hp#L19-L20

Have no answer to the notices you see but none show on a clean install.
I looked at the latest code and noticed that it was the same. The trouble being a clean install has no new added pages that have been created by copying a current page and renaming it.

I have had a quick look through the addons and may have missed something, but is there something that will add a sensible url page title and also meta header and description details when creating a new page using the built in page builder thing in the latest version. Last time I ;looked it came up with something really not connected to the content on the page.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by heatherbell »

14Steve14 wrote: Wed Sep 07, 2022 8:30 amThe trouble being a clean install has no new added pages
The github links show 2 pages with same language constants.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by ecartz »

14Steve14 wrote: Tue Sep 06, 2022 9:12 am Which is expected as the same text appears in all language files for those pages.
Except that each page should only load two language files: english.php and english/[page].php so (e.g.) privacy.php and shipping.php should not share a language file other than english.php

Check:

1. That you don't have META_SEO_TITLE and/or META_SEO_DESCRIPTION in includes/languages/english.php
2. That you aren't loading language files from more than one page.
3. That you aren't loading the same language file more than once.

If all else fails, define META_SEO_TITLE and META_SEO_DESCRIPTION before you require includes/application_top.php which should break things earlier and tell you all the other line numbers where they are defined (currently you miss the first time).

Note that the easiest solution is probably to define the pages_seo_description plus the navbar_title or pages_title for the page in admin/info_pages.php while leaving off the META_SEO_TITLE and META_SEO_DESCRIPTION from the language file. If you have the ht_pages_seo.php installed, that should work on all pages. Assumes that you have a variable named $page e.g. https://github.com/CE-PhoenixCart/Phoen ... cy.php#L13

The pages_seo_description comes from s08e01 - Info Page Meta. The other two are in core.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

Thank you @ecartz Cracking answer as usual.

Looks like I may have to convert all the pages to the info pages system and see if that works. I don't really want to lose all the current SEO stuff as some of the pages rank quite well and converts viewers to customers.

I am just trying to remove any errors before I start work on updating my 1.0.7.11 site to the latest version the site so its easy to copy all my additional pages across.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by Kofod95 »

Maybe this will help making the info pages even better for you: app.php/addons/free_addon/info_pages_pretty_urls

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

Phoenix 1.0.9.1 PHP8.0

Sorry to drag up an old post again but I am once again getting error logs full of similar errors.

They are all starting like this
[31-Oct-2024 17:14:18 Europe/London] PHP Warning: Constant META_SEO_DESCRIPTION already defined in
31-Oct-2024 17:14:18 Europe/London] PHP Warning: Constant META_SEO_TITLE already defined in
It goes on to list every other additional page in the language file multiple times.

There are also lots that start like
[31-Oct-2024 17:14:18 Europe/London] PHP Warning: Constant HEADING_TITLE already defined in /home/####/####/includes/languages/english/account_newsletters.php on line 16
[31-Oct-2024 17:14:18 Europe/London] PHP Warning: Constant NAVBAR_TITLE_1 already defined in /home/####/####/includes/languages/english/account_notifications.php on line 13
[31-Oct-2024 17:14:18 Europe/London] PHP Warning: Constant NAVBAR_TITLE_2 already defined in /home/####/####/includes/languages/english/account_notifications.php on line 14
These are the only errors showing in the log files

This is something that has only very recently started happening as I had got the site working without any errors.

As far as I am aware I have not touched anything that could be creating or causing these errors. The site has been live now for a while and has been running fine with no errors.

As far as I am aware the hosts have not updated anything or changed anything.

The only thing I have done is changed the position of one line in the htaccess file but that was to add in to make rainers url lite mod work. I have reverted the htaccess file back to how it was and these errors are still appearing.

Can anyone shed some light.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: New pages created by copying original page such as about_us.php SEO help

Post by 14Steve14 »

As I cannot find a cure for this I have applied a sticking plaster for now which I hope is correct. It does seem to be suppressing the already defined warnings in the error logs but allowing other to show.

I have added the following to the shop site configure file.
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);


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