Wordpress SEO - What are you looking for?

If you're looking for answers to SEO or wordpress related questions, type in a phrase and wait for hints or click enter! The results also show links to external sources.

161 articles in the database

Open Graph in WordPress

[ Article content is protected by Plagiashield ]

wordpress-facebook

Today I'm going to show like easily implement Facebook Open Graph at pagesę WordPress for standard articles by means of plugs as well as without its help. Let me start by explaining what Open Graph.

He describes on our website data in such a way that Facebook can use exactly the data we indicate to him. Below is an example by Share article:

open-graph

1. To do this, you need to include the following in your template websites put the following code in the functions.php file:

function wp_opengraph_for_posts() {
if ( is_singular() ) {
global $post;
setup_postdata( $post );
$output = '' . "n";
$output .= 'esc_attr( get_the_title() ) . '" />' . "n";
$output .= 'url"' content='' . get_permalink() . '" />' . "n";
$output .= '' . "n";
if ( has_post_thumbnail() ) {
$imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
$output .= '' . "n";
}
echo $output;
}
}
add_action( 'wp_head', 'wp_opengraph_for_posts' );

2. Then in the header.php file we find our tag and replace it with one like this:

  prefix="og:http://ogp.me/ns#">

Plugin for Open Graph

If you are using All in Seo Pack (enable and configure the Social Meta plugin via plugin options) or Yoast SEO (SEO => Communities) you can use their feature to tag items for FB.

WP Facebook Open Graph protocol

I've tested several of them and this one seems to me best. After installing the plugin panel is added to the options where we can find:

  • User account ID - be sure to enter the ID of your FB profile/page.
  • The default image that will be displayed if the article does not have one.
  • Forcing the use of via Facebook just from this url picture given above

open-graph-plugin

Wojciech Wladzinski

O Wojciech Wladzinski

I have been dealing with SEO industry since 2008. At co day senior SEO specialist in the company Seogroup. I create and optimize large websites as well as smaller ones. I'm especially fond of WordPress environment, which despite the popular opinion is not only a blogging platform.
  • Internal Links and Sematics

  • Link building
  • Sematics
  • Link building has never been easier. Hundreds of link possibilities in one click.
  • See

[ Article content is protected by Plagiashield ]

SEMRush - the best tool for SEO and PPC.

en_USEnglish
Read previous post:
How to clean a page header without a plugin

Wordpress by default spits out a lot of unnecessary code via wp_head(). Today I'll show you how to remove it (in the vast majority of cases right)...

Close