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

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] WPForo is not genereating og:image tags.

7 Posts
3 Users
5 Reactions
7,755 Views
WPForoNoob
Posts: 32
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
(@wpforonoob)
Trusted Member
Joined: 8 years ago
[#6101]

Hi,

I am using WPForo to create a forum on my site. However, I can't figure out how to add og:image tags using WPForo. πŸ™‚

The plugin generates following tags:

Β 

<!-- wpForo SEO -->
<link rel="canonical"/>
<meta name="description" content="" />
<meta property="og:title" content="" />
<meta property="og:description" content="" />
<meta property="og:url" content="" />
<meta property="og:site_name" content="" />
<meta name="twitter:description" content=""/>
<meta name="twitter:title" content="" />
<!-- wpForo SEO End -->

Is there any setting that I can change to generate og:image tag in WPForo?

Thanks.


Topic Tags
6 Replies
Robert
Posts: 10718
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: 2 months ago

You should have some image in topic post. This tag is generated once wpForo detects an image in post content. Here is a good topic to see that in action: https://wpforo.com/community/general-discussions/sharing-wpforo-links-on-linkedin/

If you want to have a default og:image for cases when there is no any image in topic posts you can put this code in WordPress theme functions.php file. Just change the red marked image URL to your website/forum logo URL:

function my_default_og_image( $image_url, $type ){
if( $type == 'og:image' && !$image_url){
return 'https://example.com/images/mylogo.jpg';
}
else{
return $image_url;
}
}

add_filter('wpforo_find_image_url', 'my_default_og_image', 10, 2);

How to Easily Add Custom Code in WordPress (without Breaking Your Site)

Β 

Β 


WPForoNoob
Posts: 32
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
(@wpforonoob)
Trusted Member
Joined: 8 years ago

Thank you very much Robert. 🙂

You are awesome when it comes to resolving WPForo related queries.


Posts: 21
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
(@davehamilton)
Eminent Member
Joined: 8 years ago

Is anyone successfully using Yoast to generate default og:image tags on wpForo pages? I've got Yoast all setup and working across the rest of the site, but for some reason it seems to not want to populate even the default og:image tag there?


Robert
Posts: 10718
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: 2 months ago

@davehamilton,

Β Yoast SEO has no chance to work with wpForo, because wpForo doesn't based on custom post types. Thus wpForo comes with its own built-in SEO features. wpForo generates "og:image tags" on topic page if the topic contains some image in topic post. This tag is generated once wpForo detects an image in post content. Here is a good topic to see that in action: https://wpforo.com/community/general-discussions/sharing-wpforo-links-on-linkedin/

If you want to set a default image for all forum pages you should use this code in your WordPress theme as it explained in my replay above: https://wpforo.com/community/how-to-and-troubleshooting-2/wpforo-is-not-genereating-ogimage-tags/#post-16386


Page 1 / 2
Share: