Tagging People and Fanpages via Facebook Graph

Standard Tag in Post @Username 

To Tag Friends on Facebook via Graph the massage needs to be in following format 


If you want to tag an user with the ID 0123456789, having name Peter Metabaron, you have to include the following in your message tag:

@[{0123456789}:1:{Peter Metabaron}]
@[1234567890:1:Peter Metabaron]

achieved via the Graph API same for Fanpages 

To Tag a Fanpage or Virtual Fanpage like a Blogpost use the Fanpage UID or User UID

User Tag with Uid will not link or notify Text part is irrelevant

@[458025154231865:Social Media Tipps]

You can test that in the Facebook Graph explorer 

Tag of Chat objects in the chat window for example anim Emoticons Gifs


We can link blog graph words with the related uid see writing in Bold on facebook

Same format should work when upating Facebook via Twitter or Google Calendar Feeds -> Birthdays Greets. User can turn off Tagging in his Privacy settings.


Old Rest Api Examel

$uid = "0123456789"; //User's Facebook ID, set the value as "me" if publishing on logged in user's wall
$ufname = "Peter Metabaron"; // User's Full name on Facebook
$attachment = array(
'message'=> "Happy B-Day, @[".$uid.":1:".$ufname."]!",
try {
$post = $facebook->api('/'.$uid.'/feed', 'post', $attachment);
print_r($pp); //show the tagged post ID
} catch (FacebookApiException $e) {
New Graph version 

Facebook Photo Tagging Friends


Facebook Reference Photo Tag dev

PHP GD Libery Merge Photo imagecopymerge



Notify of
oldest most voted
Inline Feedbacks
View all comments
Silvio Beach
Silvio Beach
7 years ago

it doesn’t work.

Amir Esmann
Amir Esmann
7 years ago

What does not work ? @[458025154231865:274:Social Media] just tested again still works make sure the Object ID exist .Works on Pages . Comments not sure