Facebook ‘share’ & Twitter ‘tweet’ Link Generator

Option 1: Simple meta tags to control Facebook Share info

You can control the content Facebook uses for sharing links via the follow meta tags in your HTML:

General format: <meta property=”og:{tagName}” content=”{tagValue}”/>


<meta property=”og:image” content=”http://davidrs.com/wp/wp-content/uploads/2013/01/github.png”/>

<meta property=”og:title” content=”David’s Facebook Twitter Gen.”/>

<meta property=”og:url” content=”http://davidrs.com/wp/facebook-feed-link-generator/”/>

<meta property=”og:site_name” content=”David Rust-Smith Blog”/>

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

Facebook Debugger / Testing: https://developers.facebook.com/tools/debug

Option 2: more control, but more work and more code.

If you’re trying to make a share button (also called a ‘Feed Dialog’), like this one: Share This , there’s a long complicated way with JavaScript, great for finer control, but if you want something quick and simple you can just build a single url to use in your html. The app below takes some basic input then builds the URI for you for both Facebook and Twitter. All source code is available on Git for PHP and JavaScript versions, see bottom of page for links.

Below the app is also a list of meta tags you can use in your <head> to control what all shares show.

Facebook & Twitter Share Link Generator

Download the Code to tweak -Available in both PHP and JS



Post Tagged with , , ,

Leave a Reply