Define the image used as a thumbnail to share on facebook

Define the image used as a thumbnail to share on facebook Once integrated facebook share button, for example with the AddThis plugin for php, joomla and wordpress. We will choose the image you want as the thumbnail for sharing on facebook. Facebook default and choose the images from your web by clicking on the button to share and shows you a page if you have more of an image on your website, so you can choose the most suitable image (a personal opinion) for the content to be shared. To avoid facebook take the liberty to do this, and avoid all the images on your website are chosen by, just add the attribute “rel =” tag that contains the image we want to choose as a single default this share. An example of this tax would be:

rel="image_src" />

This facebook already know that one should get this image as it will be the only one that contains the rel = “image_src”. In case there are more images with this rel, facebook gets all those containing it, showing the page to select the thumbnail If this method does not work properly. from whatever. We have another way to do this. Step to describe it: It consists in defining a metatag in the header that contains the property that indicates facebook documentation on their website on their own plugin. Do not forget that when we click the button only share what we do is define what url is shared, and it is facebook himself who is responsible for retrieving images we define as the default in the event that we do so. Therefore when we click on the responsibility we share to facebook. To define this meta tag, add this line:


is important, much to define the absolute URL of the image to avoid errors in image capture from facebook. This metatag is found to take only the image correctly set to “content” and not some other of our website. Indian as a note, we review the url set to share the link on our website as a bad reference is invalidated makes this process rather fucione. As a last step, in the event that we are seeing facebook continue taking the wrong image and not what we define, we can refine our page in Facebook debugger. This is useful because we facebook caches the page and images shared in this type of buttons to speed up the process. The debugger is available at: https://developers.facebook.com/tools/debug/, we just have to enter the url or urls to debug our facebook page and is responsible for debugging the web, showing us the mistakes we made, or content you are looking for and can not find that intefieren other property or other items, for example, the title , URL or image. Also check and show this, updates the cache that is stored on our site. *EYE with the debugger. We introduce the real url is used to share content, if we introduce a url and not see efecivo change we must look at this point that perhaps we are entering a url of the type: [ http://www.dominio.es/noticia/contenido.php?id=01 ]and perhaps the url that we indicate on our website when you call this encoded facebook: [ http%3A%2F%2Fdominio%2Fnoticia%2Fcontenido.php%3Fid%3D01 ] This we can see in the browser address bar once you have clicked to share content. This “forgetfulness” that can result from sharing a URL correctly with facebook we encode it with PHP through its method urlencode

¿Te ha gustado el artículo?
Sé el primero en calificar esta publicación.
1 estrella2 estrellas3 estrellas4 estrellas5 estrellas
Loading...

Suscríbete. Déjanos tu email y recibe contenido genial cada mes


Artículo escrito por

¡Exprésate! Dejanos tu comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *



Aún no hay comentarios en esta entrada. ¿Te animas?