Archived topic
Page title tag without category or tag title inside
5 replies · Started by vodryy on September 23, 2018
Hi,
is it posible to have <title> tag without text which is in the name of Category or Tag.
I tried to hide h1.page-title via css, which works. It hides title on page.
I then used hook generate_before_archive_title to generate ownl H1 tag without class page-title in it (<h1><?php the_archive_title(); ?></h1>). This shows category title on page again. Which was o.k.
There is a catch, that page title did not change, because inside the source code are now two H1 headings.
First <h1>myowncategoryname</h1> (my new)
and
Second <h1 class=page-title>categoryname</h1>
Is there a way how to remove these "class = page-title" headings.
My idea is that this is the thing what is changing the <title> of category pages.
Maybe is <title> tag of category pages generate another way.
Could you please help to resolve this or explain how the <title> on category pages is generated?
Best Regards
Jiri
Hi there,
The <title> of the page is generated by WordPress, usually using the name of the page/post/category.
Have you considered using a plugin like Yoast SEO? It allows you to set the <title> tags for these areas individually.
Let me know :)
Hi Tom,
I am using All in One Seo plugin. It allows me to set <title> on category page.
There is option to have %category_title% | %blog_title%.
It works fine untill I try to change H1 on category page to "Product Category_Title".
Then the <title> of the page is "Product %category_title% | %blog_title%".
Is there a way how to skip the world "Product" in the <title> of category page?
It seems like H1 with class page-title is behind this.
Best Regards
Jiri
Hmm, well the %category_title% tag in any SEO plugin will take the title of that category and output it in the <title> tag.
So if you change the category title, it will change both the <title> and the <h1>.
Maybe All In One SEO has a filter available to filter out specific words? You might need to ask their support.
Hi Tom,
Thank you for reply. I will try it.
Have a nice day.
Jiri
You too :)