Author Topic: Change Meta Title of Products and Categories  (Read 10599 times)

mediakrt

  • Beginner
  • *
  • Posts: 8
  • A beginner
Change Meta Title of Products and Categories
« on: May 17, 2017, 11:51:13 am »
I need to improve my metatitles. On my site the "normal" pages create a Meta-Title which containts the name of the website from the joomla core configuration ("Postname - Pagename"). The virtuemart products and category pages are not containing the pagename they are just containing the category name or on the product pages "Category Name - : Product Name" which is a total disaster. First i need to add the Page Name to the Meta Titles and second i need to remove the category title in the products meta-title. I cant find an option in the virtuemart configuration to change the meta titles. So where can i do this?

Best regards and thank you very much

I use Joomla 3.7.0 and VirtueMart 3.2.2.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: Change Meta Title of Products and Categories
« Reply #1 on: May 17, 2017, 13:17:41 pm »
You can add the meta data in  VirtueMart administrator

Category
in the meta information block
 
and

Products
under the product description tab

Regards
A

Joomla 3.9.27
php 7.4

mediakrt

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Change Meta Title of Products and Categories
« Reply #2 on: May 18, 2017, 16:11:10 pm »
Thanks for your answer but this is not what i asked. I need to change the auto-generated meta-title structure. I dont want to add the site title to all my 2124 products manually.

K&K media production

  • VirtueMart Developer Team
  • Global Moderator
  • Full Member
  • *
  • Posts: 838
  • VirtueMart Version: VM3 on J3
Re: Change Meta Title of Products and Categories
« Reply #3 on: May 18, 2017, 16:40:59 pm »
look here:
components/com_virtuemart/views/productdetails/view.html.php around line 244-250

you can use something like this in an template override for
components/com_virtuemart/views/productdetails/tmpl/default.php

Code: [Select]
$document = JFactory::getDocument();
$document->setTitle("This is my page title");




jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3737
  • using Matomo instead of Google Analytics
Re: Change Meta Title of Products and Categories
« Reply #4 on: May 19, 2017, 00:11:29 am »
@mediakrt
I think you are mixing up the title tag and the meta title tag. See here:
http://forum.virtuemart.net/index.php?topic=96085.msg316820#msg31682
Google ignores the meta title tag. See here: https://support.google.com/webmasters/answer/79812?hl=en
If you didn't read Google's advice about title tags, see here (page 4 and 5): https://static.googleusercontent.com/media/www.google.com/en//webmasters/docs/search-engine-optimization-starter-guide.pdf


Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

mediakrt

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Change Meta Title of Products and Categories
« Reply #5 on: May 22, 2017, 09:48:51 am »
@jjk: I dont mix up anything. Where did you ghet that information that google ignores the meta title tag? I think you mix up the meta title and the meta description tag. The meta title tag is still a very important tag in terms of seo, i hope you dont give this advice to any clients....

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28223
  • Always on vacation
    • Jenkin Hill Internet
Re: Change Meta Title of Products and Categories
« Reply #6 on: May 22, 2017, 10:31:12 am »
Meta title is significantly less important than it used to be. Unfortunately some people still confuse the <title> tag with <meta name="title"  .... > and Joomla used to include both in page headers.

https://www.hobo-web.co.uk/definitive-guide-to-using-important-meta-tags/
https://www.searchenginejournal.com/important-tags-2016-seo/156440/
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3737
  • using Matomo instead of Google Analytics
Re: Change Meta Title of Products and Categories
« Reply #7 on: May 22, 2017, 12:03:21 pm »
@jjk: ...The meta title tag is still a very important tag in terms of seo, i hope you dont give this advice to any clients....

Believe me - you are wrong  ;)

This is the page/browser title which is important for the search engines:
Code: [Select]
<title>CategoryName : ProductName</title>
This is a 'meta title', which is pretty much useless for SEO. Google clearly states that it ignores it. (Read the second link in my previous reply carefully)
Code: [Select]
<meta name="title" content="CategoryName : ProductName" />

If you want to include a brand in all your page titles which is different from your domain name (Google displays your domain in the serps as part of the url anyway) , an easy method would be to replace the default VM suffix '-detail' with your brand in the VM configuration.



Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

mediakrt

  • Beginner
  • *
  • Posts: 8
  • A beginner
Re: Change Meta Title of Products and Categories
« Reply #8 on: November 09, 2018, 11:33:38 am »
Hey guys, i had the same problem today with another VirtueMart Shop and found this article again.

I fixed the problem and let you know what i think is the perfect solution.

To overwrite the title of the product category create a template override of the default.php in your template <html/com_virtuemart/category>.

There use the following code to create a title override:
Code: [Select]
$document = JFactory::getDocument();
$document->setTitle($this->category->category_name . ' -  <YOUR COMPANY / SITENAME PLACEHOLDER>');

And it works. You can create an override for the products-page the same way as i did for the category-page. For that create an override of the default.php in <html/com_virtuemart/productdetails>.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: Change Meta Title of Products and Categories
« Reply #9 on: November 09, 2018, 11:57:47 am »
Maybe, rather than hard coding your site name, you could get it from the site configuration

Code: [Select]
$config = JFactory::getConfig();
$document = JFactory::getDocument ();
//ensure title with trailing site name
$document->setTitle($this->category->category_name . ' - ' . $config->get('sitename'));

Regards
A

Joomla 3.9.27
php 7.4

LTCreations

  • Beginner
  • *
  • Posts: 40
  • Mr. Garrison
    • City Directory On Line
Re: Change Meta Title of Products and Categories
« Reply #10 on: July 26, 2021, 23:40:09 pm »
I have to agree with mediakrt.
I've been chasing my tail for a couple of days on similar.

I've created different titles for every page. I get rave SEO scores from google - except on the Virtuemart products pages. No matter what I do (e.g. Joomla menu; Virtuemart Product Description tab items; Canonical plugin), there is NO way I've found to disable the <meta name="title" content="SEO Classroom" /> that is just above the <title>Learn SEO | Step-by-Step Instructions</title>. As you can see, both are completely different. But, according to SiteChecker and Lighthouse, there are too short titles, no canonical link tag, and other issues that cannot be altered in Virtuemart.
Quite frankly, instead of coming up with various ways in an attempt to provide necessary changes for SEO, why not leave all of the fields blank so that the developer can complete each field "per-product" - just as you can in Joomla menu items?

Overriding the Language is not helpful. That's going to hurt other pages.
I don't know about mediakrt, but I'm not looking to change all pages to something. I want to be able to edit 1 page at a time, then apply the same resolve to other pages in Virtuemart.

Also, google may have eluded to not placing as much weight on the meta name="title", but it's in all of their reporting. So if it's not important, why would you be getting a lot of points off SEO reports if they don't care about that?
Arguing over whether or not it's of any importance is not helpful.
Finding a resolution would be helpful.
I'm guessing mediakrt left this forum unhappy and without a resolve.
I, on the other hand, have been around since before Virtuemart and will always support Virtuemart - even if this issue has no resolve. I'll figure out something....but it would be nice to know of a way from those who create the software.

sirius

  • Jr. Member
  • **
  • Posts: 132
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: Change Meta Title of Products and Categories
« Reply #11 on: July 28, 2021, 14:38:29 pm »
Hi,
to remove the <meta name="title" the hard way

Line 99 : /libraries/src/Document/Renderer/Html/HeadRenderer.php

Replace
Code: [Select]
elseif ($type != 'http-equiv' && !empty($content))With
Code: [Select]
elseif ($type != 'http-equiv' && !empty($content) && $name != 'title')
I can't understand why Joomla keep this <meta name="title"...
J3.10.2 | PHP 7.4.24 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 3.8.9

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: Change Meta Title of Products and Categories
« Reply #12 on: July 28, 2021, 17:28:01 pm »
Hi,
to remove the <meta name="title" the hard way

Line 99 : /libraries/src/Document/Renderer/Html/HeadRenderer.php

Replace
Code: [Select]
elseif ($type != 'http-equiv' && !empty($content))With
Code: [Select]
elseif ($type != 'http-equiv' && !empty($content) && $name != 'title')
I can't understand why Joomla keep this <meta name="title"...

lol

In your template.

after <head>


<?php $this->setGenerator('SITENAME'); ?>

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1234
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Change Meta Title of Products and Categories
« Reply #13 on: July 28, 2021, 17:39:03 pm »
Sorry, my google translator don't understand why mixing generator in head and meta title from joomla :D

I want and need meta title from Joomla and understand why joomla keep it.
Pls keep it next.

Thanks

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

sirius

  • Jr. Member
  • **
  • Posts: 132
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: Change Meta Title of Products and Categories
« Reply #14 on: July 29, 2021, 09:34:46 am »
lol

In your template.

after <head>


<?php $this->setGenerator('SITENAME'); ?>

Roflol

the meta are injected in the head directly by the HeadRenderer.php

This tag:
Code: [Select]
<?php $this->setGenerator('SITENAME'); ?> is for the <meta name="generator"
And if you have it in your templates, I don't.

This is what you'll find in your template
Code: [Select]
<jdoc:include type="head" />
You also can have a specific file for the head, but it still need to have <jdoc:include type="head" />

@pinochico
Great, please explain me why joomla keep the <meta name="title" and why you need it ?
J3.10.2 | PHP 7.4.24 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 3.8.9