Facebook API: how to post TO a page and AS the page

November
30th,
2011

Today I will show you how you can post to Facebook pages with the identity of those pages. One of my readers came up with this question and truth is it is useful if you have various pages to administer.

How does it work?

As usual you need to first install a copy of the Facebook PHP SDK to authenticate user/app/permissions.

Try it yourself

Go to this page and log in with FB, you will be asked to grant the "manage_pages" permission. Then the page shows a list of all your Facebook pages with an option to post to each one of them.

So this is a quick and easy way to administer all your pages. You can see this in action in the video demo below:

Code

The code can be downloaded here - after putting it on your domain, you need to add your URL your FB App configuration page. Then you need to update "your app id" and "your app secret" with the App codes.