Change Meta Title of Products and Categories

Started by mediakrt, May 17, 2017, 11:51:13 AM

Previous topic - Next topic

mediakrt

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

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.10.11
php 8.0

mediakrt

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

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


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





jjk

@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

@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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

jjk

Quote from: mediakrt on May 22, 2017, 09:48:51 AM
@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:
<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)
<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

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:

$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

Maybe, rather than hard coding your site name, you could get it from the site configuration


$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.10.11
php 8.0

T.A. Garrison, LLC

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.
T.A. Garrison, LLC
3150 Orleans St. # 28261
Bellingham, WA 98228

sirius

#11
Hi,
to remove the <meta name="title" the hard way

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

Replace
elseif ($type != 'http-equiv' && !empty($content))
With
elseif ($type != 'http-equiv' && !empty($content) && $name != 'title')

I can't understand why Joomla keep this <meta name="title"...
J3.10.12 | PHP 7.4.33 + APC + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777

PRO

Quote from: sirius 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
elseif ($type != 'http-equiv' && !empty($content))
With
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

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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sirius

#14
Quote from: PRO on July 28, 2021, 17:28:01 PM
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: <?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 <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.12 | PHP 7.4.33 + APC + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777