Changing how og:title_name appears on Facebook for posts

Hello :slight_smile:

Trying to control what appears on FB shares for my site. The main two things I want to do are:

a) When users share posts to FB via the Ultimate FB plugin I want the url showing under the title of the post and the description to be changed from the URL of the post to a title of my choosing (I thing this is the og:site_name property of Open Graph) .

b) Every time someone shares the main URL of the site I want (again) to show the og:site_name to a name I choose plus with a photo choose.

I have tried to do all this via the OpenGraph properties of the Ultimate Facebook plugin and the SmartCrawl one but nothing happens. Please see attached screenshots of my changes.

I am sure there is sth I haven't done right here since this is the first time I try to do this.

NOTE: My Ultimate Fb plugin is a "custom" one provided by your devs as a result of a previews ticket (https://premium.wpmudev.org/forums/topic/facebook-login-and-fb-posts-not-working#post-1149173)

  • Sajid
    • DEV MAN’s Sidekick

    Hi Nick,

    Hope you are doing good today :slight_smile:

    You can set all the open graph values from the individual post metabox. For site_name, UFB will get the name of site set in settings -> general -> site title.

    Did not that worked for you ?

    If no then you can also try below code to set custom sitename:

    function change_site_name_og_value($name){

    return $name = 'My Custom Value Goes Here';
    }
    add_filter('wdfb-opengraph-site_name', 'change_site_name_og_value', 10);

    Add it in functions.php file of your child theme or use it as mu-plugin.

    Also, please note that, Facebook caches the data once its shared on FB. After making changes you have to force FB scrape the data again via Facebook debug tool here:

    https://developers.facebook.com/tools/debug/

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,

    Sajid

  • Nick
    • Design Lord, Child of Thor

    Hello Sajid

    Thanks for your quick reply.

    Maybe I got you a little confused because I did not phrase my question with the right terms.

    What I want to do is change what is in red circle in attachment “PostOnFB.png

    ” (see above).

    I suppose this is the og:url value which s now set as the default URL of the site. I want to change this to a name of my choice, lets say “Eternal-rado.net”

    I am sorry for the inconvenience ….

    Nick

    P.S.

    This is what I get from FB share debugger (so it seems site title is OK from the general settings…. I think what I am after is changing the og:url

    <meta charset=”UTF-8″ />

    <meta name=”viewport” content=”width=device-width” />

    <meta name=”generator” content=”WordPress 4.6.1″ />

    <meta name=”description” content=”music lasts forever” />

    <meta name=”keywords” content=”radio, web, web radio, webradio, music, stream, playlist” />

    <meta property=”fb:app_id” content=”1666742353641556″ />

    <meta property=”og:type” content=”website” />

    <meta property=”og:title” content=”Eternal Radio” />

    <meta property=”og:url” content=”http://www.infonautics.info/eternalradio/” />

    <meta property=”og:site_name” content=”Eternal Radio” />

    <meta property=”og:description” content=”music lasts forever” />

  • Nick
    • Design Lord, Child of Thor

    Looking deeper into the matter I found from the FB debugger the Opengraph properties for the http://www.eternal-radio.net that frame-redirects to http://www.infonautics.info/eternalradio

    The behaviour of the share is the desired one except from the og:image which does not show the og:image declared to opengraph for the wordpress intall URL managed via the UF dashboard (see attachment).

    So the question is this:

    Since I am able to declare the desired OG values on the UF dashboard for the wordpress URL (www.infonautics.info/eternalradio), what is the way to change the OG values for the http://www.eternal-radio.net URL that redirects to the wordpress URL?

    Thank you,

    Nick

  • Sajid
    • DEV MAN’s Sidekick

    Hi Nick,

    Hope you are doing good today :slight_smile:

    Thanks for providing more information regarding this issue. I forget to mention that you can optionally add the additional og tags and values from backend.

    However, you figured it out and you are using the right tag and value for this. That is og:site_name, see this site for reference – http://ogp.me/.

    I can see that you have it configured and its being applied on frontend too. But for some reasons, Facebook does not entertain the site_name opengraph meta tag and constructing different set of open graph tag for the URL. Right now its getting extracting the name of site from URL.

    For example, if I share http://www.infonautics.info/eternalradio link then the name is infonautics.info and if I share http://www.eternal-radio.net/ then the name is eternal-radio.net (see screenshots).

    So the conclusion is, the tags are working and the plugin is also generating the tags according to setting in source code but for some strange reason FB is skipping this tag.

    I tried to search high and low but could not find the reason of why FB ignoring the site_name tag.

    Hope that helps! If you still need assistance, please don't hesitate to ask.

    Take care and have a nice day :slight_smile:

    Kind Regards,

    Sajid J

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.