Meta Author does not embed when sharing on Facebook

Asked

Viewed 434 times

1

When I share a link from my site on a Facebook page, "by AUTHOR" is not showing up. I have already informed all the correct social networks within my user profile. I am using the YOAST plugin. As I have other sites where this is working as I have left the same options equal. I don’t know what can be.

inserir a descrição da imagem aqui

Update: Error in Object Debugger. inserir a descrição da imagem aqui

Update 2: It’s working, but there are these two errors. inserir a descrição da imagem aqui

Source code for the URL I tried to share http://pastebin.com/t0pB4qFy

  • 3

    Post the HTML structure of the generated meta tags.

  • 1

    This may be related to the facebook cache. Please see this question: http://answall.com/q/115902/4793

  • As @Guilhermenascimento said, it would be convenient for you to post the tag structure. Maybe this article can help: http://tableless.com.br/utilizando-meta-tags-facebook/

  • @Felipe-Stoker I posted an answer that I believe is valid, I would like to know solved your problem?!

  • @Cleidimarviana has not solved yet.

  • @Felipestoker, I tried to dig deep into the question, and you’re really forgetting to close any quotes or anything like that. I changed my answer by putting an example of keyboard comparison. Take a look and make a comparison with your tags. If you provide the link of your site, I can take another look. Good Luck ai! Vlw. Flw

  • @Cleidimarviana for sure, the link is www.bettercallsaul.com.br

  • @Felipestoker eh cara, I saw that has some goals different from Techmundo, in which I quoted in my answer. You’ll have to review everything you’ve done so far, all of the metas and try to fix it. I did what I could! = ) I can’t get any more than that! Abs. Good Luck.

  • @Cleidimarviana Ball Show, thanks. Just a doubt, YOAST does not include the goals automatically?

  • 1

    @Felipestoker is basically what you have to do, including Facebook Open Graph, Twitter Cards, and Google+ meta data. If you are not doing it, you can uninstall and install again, setting up from scratch, by consciousness-raising.

  • 1

    Press Ctrl+U on the page copy the generated HTML source and paste into the question (if it is too big paste into http://pastebin.com and put the link in the question), so we will have a sense of what is breaking your HTML, it is quite likely that it is some other plugin or something you, until then we have no way to find out.

  • @Guilhermenascimento edited the question with the source code.

Show 7 more comments

5 answers

5

Hello, the metatag that Facebook uses to get the author who posted the post is this:

<meta name=”author” content=”nomedoautor”>

Well, this has to be inserted somewhere in the post, so I made the following PHP function that should be added to functions.php

This can be done on the wordpress itself by going into Appearance Editor control panel

On the side you should select Theme Functions (functions.php) and at the end of the file by pasting the following code:

function adiciona_tag_autor_facebook($content) {
    if (is_single()) {
        echo '<meta name="author" content="' . get_the_author() . '"/>';
    }
    return $content;
}

add_filter('the_content', 'adiciona_tag_autor_facebook');

Well, as the friend said above, the first time you click to share a post on facebook, is generated a cache, in this case do the procedures that Fagner Souza said and try to share again on your facebook Timeline. (The procedures said by him will make facebook delete the current cache and generate a new one with updated information).

Or, create a new test-only post and see if the author’s name appears on the facebook card.

I hope I helped, good luck.

4

  • I did that and an http://prntscr.com/c8ncp3 error appeared

  • @Felipestoker checks your tags, to see if they are straight. The meta-tag too. Must be an HTML structure problem

  • Oi Felipe, has to review the Wordpress template and ensure that the tags are within the header? Facebook is full of "particularities", for example, see my saga due to a blocked favicon.

  • I’ve done it before, but it’s still the same.

3


The problem is that the Facebook code was injected before the doctype:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.6&appId=1608515189361899";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!DOCTYPE html>

That is it is likely that you have entered manually, to fix, you will have to take this part and add inside BODY somehow:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.6&appId=1608515189361899";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
  • I will install Wordpress and then give a suggestion

  • Ahh understood, can I put this code before the </body closes>?

  • @Felipestoker yes, perfect, is the most appropriate place.

  • Do you know where the Body lock usually is? because in header.php it is not.

  • @Felipestoker would be in the footer.php? But I think you have to add by theme: Appearance -> Editor -> Current theme name

  • Almost there man, it’s working, but there are two mistakes in the Bugger, you know what can be?

  • @Felipestoker could send the bugs to me to read?

  • I forgot to mention. I put the bug in my question update 2.

  • 1

    @Felipestoker you added the url metatag twice, the article-type metatags can only have one og:url

  • You know what might have caused this? 'Cause I did everything for YOAST.

  • @Felipestoker installed here and works normally, you must have some additional plugin that this affecting, when it comes to SEO it is best to only use a plugin of type, use more than one can give problems.

  • How strange, the other one I have is Shareaholic | share Buttons, Analytics, Related content, but this is just to share the content of the page. I wonder if it’s him?

  • @Felipestoker disables all and activates with Ctrl+U and F5 until you find out which one it is

  • 1

    I found out, it was something of the theme.

Show 9 more comments

1

With Yoast Wordpress SEO plugin

With the plugin Yoast Wordpress SEO, you need to enter SEO » Social page in Wordpress administration and check if box next to "Add Open Graph meta data" is marked.

inserir a descrição da imagem aqui

The next step is to add your Facebook ID to your Wordpress account. Just visit Users » Your Profile and enter the URL of your Facebook profile and click the Save button to store the settings as shown below:

inserir a descrição da imagem aqui

No Yoast plugin

If you want to add meta tag 'author' on your site without a plugin, just add the following code on your site <head>.

<meta property="article:publisher" content="http://facebook.com/seuperfil" />
<meta property="article:author" content="http://facebook.com/seuperfil" />

Take a look at these links:

As for the error image

In its proper translation:

Your page has meta tags on body instead of head. That might be because the HTML is badly formed and they fell lower on the tree of analysis. Please fix this so that tags to be usable.

Try to format your code using this site: https://www.dirtymarkup.com/ . Maybe there are some quotes closing in the wrong place.

Observing

I checked the metas of the website of Techmundo in the Open Graph Object Debugger and us results returned these three values below for facebook:

<meta property="fb:pages" content="111090485635468" />
<meta property="fb:app_id" content="247082808662914" />
<meta property="fb:admins" content="valdbaixaki" />

Try to compare with your results and make the appropriate changes.

See the image below: inserir a descrição da imagem aqui

  • So in YOAST I did exactly as you showed in the image. But still it does not show.

  • I will not do via code as the username may vary.

  • @Felipestoker Got it!

  • I updated the question with an error appearing in the facebook Bugger.

0

The problem seems to be in HTML semantics, as urged by the facebook message:

inserir a descrição da imagem aqui

Fix placing the metatags inside the tag <head></head>.

Example:

<head>
<meta property="article:author" content="Nome do Autor" />

outras metatags também devem estar aqui.


</head>

After that, update the cache in the facebook Bugger: https://developers.facebook.com/tools/debug/og/object

Check if there are no other semantic errors, because facebook may refuse if you encounter another error.

To check the HTML validity: https://validator.w3.org/

And don’t forget to always update the cache on the facebook debug page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.