Advertisement
Change H2 to H1 il blog
Moderators: ooffick, 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.
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.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Change H2 to H1 il blog
Hello and Happy New Year,
I would like to change the H2 titles of the blog articles to put them in H1. (and only of the blog not for the other categories). The problem is that all the articles of the blog have the same title H1 which is the title of the blog which is bad for SEO.
Does anyone know in which file to do an overload and which part of the code to locate?
I suppose it is in com_content > blog.php, but I can't find it.
As for the code it should look like ($this->item->title) . '</h2>' to transform into ($this->item->title) . '</h1>' but I'm not sure.
I would like to change the H2 titles of the blog articles to put them in H1. (and only of the blog not for the other categories). The problem is that all the articles of the blog have the same title H1 which is the title of the blog which is bad for SEO.
Does anyone know in which file to do an overload and which part of the code to locate?
I suppose it is in com_content > blog.php, but I can't find it.
As for the code it should look like ($this->item->title) . '</h2>' to transform into ($this->item->title) . '</h1>' but I'm not sure.
Advertisement
- AMurray
- Joomla! Master
- Posts: 10488
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: Change H2 to H1 il blog
styles like that are done in CSS not PHP. Don't change core files, create overrides.
Regards - A Murray
Global Support Moderator
Global Support Moderator
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
I don't now how I can change H2 to H1 utilizing CCS.
Can you tel me ?
Can you tel me ?
-
- Joomla! Champion
- Posts: 6575
- Joined: Tue Aug 23, 2005 1:56 pm
- Location: South coast, UK
- Contact:
Re: Change H2 to H1 il blog
https://gadsolutions.biz Electrical services
https://electrical-testing-safety.co.uk Testing services
https://electrical-testing-safety.co.uk Testing services
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
It is not possible to change an HTML title <h2> to <h1> using CSS, because CSS does not change the HTML structure. CSS can only change the visual appearance of an element.
When you don't know, it is best to keep quiet.
When you don't know, it is best to keep quiet.
-
- Joomla! Champion
- Posts: 6575
- Joined: Tue Aug 23, 2005 1:56 pm
- Location: South coast, UK
- Contact:
Re: Change H2 to H1 il blog
I answered your question. You can be sure Hell will freeze over before I help you in the future.
https://gadsolutions.biz Electrical services
https://electrical-testing-safety.co.uk Testing services
https://electrical-testing-safety.co.uk Testing services
-
- Joomla! Guru
- Posts: 607
- Joined: Fri Dec 02, 2005 10:46 am
- Location: The Netherlands
Re: Change H2 to H1 il blog
Can you explain a bit more? Maybe with examples.
Where do you want to change the headings?
On the page with article intros (Category Blog)? Or on the full article?
From what I can understand I think you need to create an override.
Where do you want to change the headings?
On the page with article intros (Category Blog)? Or on the full article?
From what I can understand I think you need to create an override.
- ceford
- Joomla! Hero
- Posts: 2979
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Change H2 to H1 il blog
A page should only contain ONE h1 heading. Joomla sets article titles to h2 in blog layouts but h1 in single article layouts. If you defy the ONE h1 standard your SEO will take a hit - seems to to be the exact opposite of what you want.
- Pavel-ww
- Joomla! Ace
- Posts: 1807
- Joined: Tue Jun 30, 2020 12:17 pm
Re: Change H2 to H1 il blog
Hi. Turn OFF page heading in Category Blog menu item settings. -
Turn ON category discription (if OFF). --
Use Category Discription editor to add h1 to the category page only. After that, all main headlines inside the articles will automatically turn into h1.
Or if you want to make override
-------------------
I want to note that the Page Heading option in the aspect of categories and the addition of it to the article pages is not SEO and user friendly. This behavior should be corrected for a long time, but continues to remain in Joomla for decades. Therefore, we have to look for workarounds.
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
Hello Pavel Wimpy and ceford,
I give an exemple. The blog "News" has 10 articles named "news 1", 2, 3, 4, etc...
Each article has for H1 "News" and for H2 "news1", "news 2", etc.
Having 10 H1 titles "News" seems bad for SEO.
It seems to me that it would be better to delete "News" and have "news1", "news 2", etc. as H1 titles.
to Pavel-ww
I have already tried as you say by going through the Joomla interface. The problem remains the same: all the articles of the blog have an identical H1 title and the specific titles of each article remain in H2.
Yes, I want to do an override. The method you give seems the right one. But, I am afraid that by going through default.php it will apply to the whole site.
Wouldn't it be better to modify blog.php ?
I give an exemple. The blog "News" has 10 articles named "news 1", 2, 3, 4, etc...
Each article has for H1 "News" and for H2 "news1", "news 2", etc.
Having 10 H1 titles "News" seems bad for SEO.
It seems to me that it would be better to delete "News" and have "news1", "news 2", etc. as H1 titles.
to Pavel-ww
I have already tried as you say by going through the Joomla interface. The problem remains the same: all the articles of the blog have an identical H1 title and the specific titles of each article remain in H2.
Yes, I want to do an override. The method you give seems the right one. But, I am afraid that by going through default.php it will apply to the whole site.
Wouldn't it be better to modify blog.php ?
- Pavel-ww
- Joomla! Ace
- Posts: 1807
- Joined: Tue Jun 30, 2020 12:17 pm
Re: Change H2 to H1 il blog
Now you confused mepjuignet wrote: ↑Fri Jan 17, 2025 10:01 am to Pavel-ww
I have already tried as you say by going through the Joomla interface. The problem remains the same: all the articles of the blog have an identical H1 title and the specific titles of each article remain in H2.
Yes, I want to do an override. The method you give seems the right one. But, I am afraid that by going through default.php it will apply to the whole site.
Wouldn't it be better to modify blog.php ?

-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
The site is a French university site:
https://philosciences.com
The home page is "Actualités". It is a blog of "Actualités" category that has 195 articles. If I let the category name be displayed, there are 195 identical H1 titles "Actualités". In my opinion, this is not good for SEO.
It seems to me that it would be better if the titles of each article were H1.
By exemple, on the current page, the title of the article "Artificial Intelligence and its political, cultural and societal implications" is H2. It is better if it is H1.
I would like the 195 titles of the 195 articles to be H1.
This may be impossible if Joomla is configured to put the blog title in H1 and the article titles in H2 ?

https://philosciences.com
The home page is "Actualités". It is a blog of "Actualités" category that has 195 articles. If I let the category name be displayed, there are 195 identical H1 titles "Actualités". In my opinion, this is not good for SEO.
It seems to me that it would be better if the titles of each article were H1.
By exemple, on the current page, the title of the article "Artificial Intelligence and its political, cultural and societal implications" is H2. It is better if it is H1.
I would like the 195 titles of the 195 articles to be H1.
This may be impossible if Joomla is configured to put the blog title in H1 and the article titles in H2 ?

You do not have the required permissions to view the files attached to this post.
-
- Joomla! Guru
- Posts: 607
- Joined: Fri Dec 02, 2005 10:46 am
- Location: The Netherlands
Re: Change H2 to H1 il blog
Ah, I see...
As it is at this moment I would:
Create an override for:
- blog.php
- blog_item.php
Rename them to:
- actualites.php
- actualites_item.php
Open actulites_item.php and change <h2></h2> to <h1></h1>
In Joomla administrator:
Open the cateogory Actualites
Go to tab: Options and set Layout to Actualites
As it is at this moment I would:
Create an override for:
- blog.php
- blog_item.php
Rename them to:
- actualites.php
- actualites_item.php
Open actulites_item.php and change <h2></h2> to <h1></h1>
In Joomla administrator:
Open the cateogory Actualites
Go to tab: Options and set Layout to Actualites
- Pavel-ww
- Joomla! Ace
- Posts: 1807
- Joined: Tue Jun 30, 2020 12:17 pm
Re: Change H2 to H1 il blog
Hi Mr. Wimpy.
Note: You can’t just override the category blog layout by copy and renaming files only. Additionally, it is necessary to create an alternative menu item and make changes to XML.
But in OP's case, the creation of an override for the blog does not make sense.
And that's why...
Hi @pjuignet.
... You use the blog category to display full articles through pagination. This is fundamentally wrong. The blog category should be listing of articles with introtext, links to full articles, read more buttons, etc.
Joomla works absolutely correctly. But you are trying to break it.

Should looks like this.

Now you have no links to individual articles, but there are links that Google perceives as an element of pagination and glues such pages. This is worse for SEO than problems with headlines. And even critically bad.
For Google all pagination links are the same page only with different GET parameters. Single articles do not have a separate SEF URLs.
You are mistaken that before that you had hundreds of H1. You had only one H1 on one page divided by pagination.
Trying to change articles headings from h2 to h1 you will receive hundreds of h1 on one page. That is, you will get exactly what you wanted to get rid of.

You should redo this using the category for its intended purpose. And then you can use the tips from my post above.
But if you want to stay on the wrong way, to create override follow the advice of Mr. Wimpy with the exception of file renaming
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
OK Pavel.
I undertand, it is not a good way.
In a first time, what I do, is to suppress the 195 blog title H1, and put <p>Actualités</p>. I have no more are 195 identical H1 titles "Actualités".
I let article tittle as h2.
In a second time what can I do ? One solution i to return to classic blog as you said.
But I want to have something like a book, we turn the pages. This is why I am trying to hijack the blog. Maybe I should give up. When you modify the code in Joomla, there are unintended effects that appear.
Thank you for your help.
I undertand, it is not a good way.
In a first time, what I do, is to suppress the 195 blog title H1, and put <p>Actualités</p>. I have no more are 195 identical H1 titles "Actualités".
I let article tittle as h2.
In a second time what can I do ? One solution i to return to classic blog as you said.
But I want to have something like a book, we turn the pages. This is why I am trying to hijack the blog. Maybe I should give up. When you modify the code in Joomla, there are unintended effects that appear.
Thank you for your help.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
Pavel,
I think about you said about
I put everything back in classic blog.
Thank you very much.
I think about you said about
You are right, even if I manage to modify the blog in the blog.php code, there will still be the problem of the urls that will mislead search engines.Trying to change articles headings from h2 to h1 you will receive hundreds of h1 on one page. That is, you will get exactly what you wanted to get rid of.
I put everything back in classic blog.
Thank you very much.

- Pavel-ww
- Joomla! Ace
- Posts: 1807
- Joined: Tue Jun 30, 2020 12:17 pm
-
- Joomla! Guru
- Posts: 607
- Joined: Fri Dec 02, 2005 10:46 am
- Location: The Netherlands
Re: Change H2 to H1 il blog
You are correct: you would need an alternative menu item in this case...
Though you can just override the layout of a category by copying and renaming.
The override would only apply if the category is not linked to a menu item.
Anyway, back to the solution...
If it should read like a book:
Yes, you should use the navigation option, suggested by Pavel.
Also I would recomend using the category list menu item and/or the articles module.
So readers can go straight to an article of interest or continue reading without having to click through all articles/pages.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
Navigation > Show
Thanks, I already did it.
Still, if a blog named BLOG has 100 pages, there will be 100 titles <h1> BLOG </h1>. Isn't that a problem for seo ?
Thanks, I already did it.
Still, if a blog named BLOG has 100 pages, there will be 100 titles <h1> BLOG </h1>. Isn't that a problem for seo ?
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
Anyway, it doesn't matter, we'll deal with it.
A problem has appeared: All the article pages now have the title News which is the title of the blog on the home page.
div class="page-header">
<h1> News </h1> If somebody has an idea ?
A problem has appeared: All the article pages now have the title News which is the title of the blog on the home page.
div class="page-header">
<h1> News </h1> If somebody has an idea ?
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Mon Apr 06, 2015 3:34 pm
Re: Change H2 to H1 il blog
By chance, I found the solution: In the home blog hide the page header and it is reflected on all the pages of the site which are then rid of the untimely title.
Joomla has some oddities!
Joomla has some oddities!
Advertisement