AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] How to remove the forum title from the html tag

6 Posts
3 Users
0 Reactions
1,617 Views
Posts: 10
 ziv7
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@ziv7)
Eminent Member
Joined: 2 years ago
[#56544]

I would like to have my html title tags like this:
Topic title - Site title
In other words, i would like to EXCLUDE the forum name title. How do I do that?


5 Replies
Sofy
Posts: 5775
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

Hi,

Please read this documentation: https://wpforo.com/docs/wpforo-v2/settings/display-components/#show-forum-page-title


Robert
Posts: 10749
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months ago

Hi @ziv7,

I assume you're talking about Meta Title. If so you should use the title hook to remove whatever you want. The hook code looks like this, it should be added in Code Snippets plugin or directly in the current active theme's functions.php file:

add_filter('wpforo_seo_topic_title', function ($title){
if( function_exists('WPF') ){
$forum_title = WPF()->current_object['forum']['title'];
return str_replace($forum_title, '', $title);
}
return $title;
} );

3 Replies
 ziv7
(@ziv7)
Joined: 2 years ago

Eminent Member
Posts: 10
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Posted by: @robert

Hi @ziv7,

I assume you're talking about Meta Title. If so you should use the title hook to remove whatever you want. The hook code looks like this, it should be added in Code Snippets plugin or directly in the current active theme's functions.php file:

add_filter('wpforo_seo_topic_title', function ($title){
if( function_exists('WPF') ){
$forum_title = WPF()->current_object['forum']['title'];
return str_replace($forum_title, '', $title);
}
return $title;
} );

 

Hey Robert!
Amazing! that's exactly what I needed.  Thank you so much!!!!!

One more little thing, if possible: now, after adding your code to my child theme, the meta titles tags of each particular topic (thread) look like this: 
Topic title - mysite.com Forum

Is it possible (by customizing your code or another way) to apply these 2 minor changes?
1. To remove the word "Forum" from the title
2. To capitalize the first character of the site's domain name?

If done correctly, the meta title tags will look like this: 

Topic title - Mysite.com

 

 


Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5775
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@ziv7

Please navigate to the Dashboard > wpForo > Boards admin page. Find the current board, edit it, and change the board title as you like.


 ziv7
(@ziv7)
Joined: 2 years ago

Eminent Member
Posts: 10
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Posted by: @sofy

@ziv7

Please navigate to the Dashboard > wpForo > Boards admin page. Find the current board, edit it, and change the board title as you like.

 

Very helpful - thanks!

 


Share: