OpenGraphiq generates all Social Network related meta tags on your static pages and post pages based on defined templates.
This enables you to fully control the appearance of your site content on social networks when shared by you or users / visitors of your site.
Tags generated by OpenGraphiq are:
For additional details related to og and twitter related tags and their meaning, please refer to the Facebook and Twitter documentation:
OpenGraphiq can work in parallel with other SEO plugins such as:
What you need to know though is that if you have both OpenGraphiq and your SEO Plugin Social sharing functionality active, they will both generate the same meta tags in your content’s markup.
This is a bad practice as duplicated meta tags compete with each other and the end results will be hard to control – it will be on specific Social Network to decide which ones it will take into account (usually the ones which appear first in the HTML source code, but this is not guaranteed).
In this case, we strongly advise that you switch off your SEO plugin’s Social sharing functionality. They all should have this option and you should consult your SEO plugin documentation on how to do so.
YOAST SEO Social Share deactivation
For Open Graph meta data, open Social menu and navigate to Facebook tab. Set option “Add Open Graph meta data” to be disabled and Save Settings.
For Twitter Cards meta data, open Social menu and navigate to Twitter tab, set “Add Twitter Card meta data” to disabled and Save Settings
All In One SEO Social Share deactivation
For Open Graph meta data, open Social Networks panel and navigate to Facebook tab. Set option “Enable Open Graph Markup” to be disabled and Save Settings.
For Twitter Cards meta data, open Social Networks panel and navigate to Twitter tab, set “Enable Twitter Card” to disabled and Save Settings
SEOPress Social Share deactivation
For Open Graph meta data, open Social Networks panel and navigate to Facebook (Open Graph) tab. Set option “Enable OG data” to be disabled and Save Settings.
For Twitter Cards meta data, open Social Networks panel and navigate to Twitter (Twitter card) tab, set “Enable Twitter card” to disabled and Save Settings
Although OpenGraphiq by default offers a wide range of options, we understand that we can not predict all use cases needed for your specific content.
That is why we have added a number of filters to allow you to additionally control the OpenGraphiq generated output.
OpenGraphiq offers the following filters:
Code Examples:
opengraphiq_template – change the template of all posts / products to Stylish (which has post id, for example: 2107):
function template_override( $template ) { $new_template[2107] = "Stylish"; return $new_template; } add_filter( 'opengraphiq_template', 'template_override', 10, 1 );
opengraphiq_image_meta – if meta field name is my_field, add additional content to its value on generated image in dynamic text field:
function meta_override( $content, $meta_name ) { if ( $meta_name == 'my_field') { return $content . ' additional content'; } return $content; } add_filter( 'opengraphiq_image_meta', 'meta_override', 10, 2 );
opengraphiq_post_image_filename – by default, og image filenames are generated using post id – for example post with the id 3421 will have og image file named 3421.jpg
This filter enables you to modify the default naming scheme. For example in order to add a random ten character suffix to the post id, each time an image is generated, you can use the following:
function og_filename_alter($filename){ $bytes = bin2hex(random_bytes(5)); return ($filename . $bytes); } add_filter( ‘opengraphiq_post_image_filename’, ‘og_filename_alter’, 10, 1 );
all other filters – add additonal string to the value generated by OpenGraphiq:
function additonal_content( $content ) { return $content . ' mystring'; } add_filter( 'opengraphiq_title', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_description', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_title', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_excerpt', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_date', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_author', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_meta', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_price', 'additonal_content', 10, 1 ); add_filter( 'opengraphiq_image_displayprice', 'additonal_content', 10, 1 );