Change the separator in the browser page titles Topic is solved

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Mon Aug 22, 2005 10:10 am

Change the separator in the browser page titles

Post by Graemezee » Fri Dec 18, 2020 2:28 pm

Currently the Site Name in Page Titles is hyphen
ie Title - Site Name is there a way to change the - to a | Title | Site Name. The seo's company I am working with have requested this and the only way i can see to do this is to off this feature and manually add the titles.

I have had this request from several SEO companies on different site so this would be very useful
would this be possible via language overrides ?

Appreciate any help

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24974
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Change the separator in the browser page titles

Post by pe7er » Fri Dec 18, 2020 3:51 pm

So you want to change the hyphen "-" in the Browser Page Title <title></title> to a pipe "|" symbol?

You can change the HTML output of Joomla using a plugin.

In this case you might look into a plugin called: ReReplacer
https://extensions.joomla.org/extension ... ereplacer/
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Mon Aug 22, 2005 10:10 am

Re: Change the separator in the browser page titles

Post by Graemezee » Sat Dec 19, 2020 12:54 am

Hi, Thanks, For you input, I have been reading the documentation For ReReplacer Looks like its the tool for the job But i would not know where to start. I have searched the language files looking for a place holder for the hyphen there are quite few, but none seem to be related to the page titles. I would assume its part of the code in the relevant php file which I have no idea about. I would be happy to buy the plugin but would need to know how to configure the change.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9707
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Change the separator in the browser page titles

Post by AMurray » Sat Dec 19, 2020 4:25 am

ReReplacer doesn't touch the database or PHP files - it doesn't work that way and you don't need to go digging into the code. The documentation explains it fairly simply.

I think the key point is you have to tell it where you want to search within the HTML document:

Examples:

Go to "Search Areas" tab and select "Head" option from the "Enable in Area" drop-down list.

Back in the "Details" tab, type in the search string to look for (the bit you want to replace)
e.g. " Mary's Puppy Training - Dalmatians"

Type in the string of text you want to replace the above with e.g. "Mary's Puppy Training | Dalmatians"

OR you could replace specific portions of the above, such as only replacing the bit after the hyphen like replace " - Dalmatians " with "| Dalmatians".

You could also search and replace the entire line of HTML (the <title> tag line) but in this instance wouldn't be necessary.

Refresh the front-end of your site (F5/Ctrl+F5) and see the browser title has changed from the hyphen to the pipe symbol.

You don't need the Pro version for this, ReReplacer is free from the JED.
Regards - A Murray
General Support Moderator

Graemezee
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 204
Joined: Mon Aug 22, 2005 10:10 am

Re: Change the separator in the browser page titles

Post by Graemezee » Sat Dec 19, 2020 11:36 pm

Hi, Thanks to both of you, so simple. Typically I started from point of complexity and totally missed the simple and the obvious. Many thanks again.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9707
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Change the separator in the browser page titles

Post by AMurray » Sun Dec 20, 2020 5:04 am

Glad the solution worked.
Regards - A Murray
General Support Moderator

jameslarson
I've been banned!
Posts: 13
Joined: Wed Feb 10, 2021 10:05 am

Re: Change the separator in the browser page titles

Post by jameslarson » Tue Mar 16, 2021 3:55 pm

The replacements are rendered on-the-fly with ReReplacer, keeping the actual text or HTML untouched. DB Replacer can be used either if you like or need to completely replace anything in your website's database.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24974
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Change the separator in the browser page titles

Post by pe7er » Fri Dec 30, 2022 8:52 am

An easier method (thanks Pablo Arias, for pointing me to this solution!) is described here:
https://stackoverflow.com/a/24039174/2027591

Create a language override for JPAGETITLE constant. Change
%1$s - %2$s
to
%1$s | %2$s
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”