A Facebook tutorial can have a short shelf life: the platform keeps changing.
But so many readers asked for updated instructions on creating and adding a tab to a Facebook page that I eventually gave in.
This article updated my earlier tutorials, How to Create a Facebook Page Tab and How to Show or Hide Fan-Only Content.
It walks through creating and adding a custom tab to a Facebook page. The original version also offered followers of my Facebook page a bonus download: a PHP template that displayed different content to fans and non-fans.
1. Configure your server
The setup described here used HTTPS hosting with an SSL certificate for the domain serving the tab.
Without a secure URL, visitors could encounter a warning like this:

2. Create the iFrame page, without conditional content for now
On your secure server, create a directory for the tab and add an index.php or index.html page.
For example, create /facebook-tab/ and put your page, images, and supporting files there. The directory URL would look like https://www.example.com/facebook-tab/.
Important: The HTML or PHP page could use inline CSS and JavaScript, but not the discontinued FBML. The tutorial’s layout was limited to 520px wide, the tab width available in the interface covered here.
This tutorial assumes you already have a page ready. It explains how to embed that page, rather than teaching HTML or PHP from scratch.
If your page is ready, as in the example below, you can move on to adding it to Facebook.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FB Tab</title>
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW">
<style>
body {
overflow:hidden;
width:520px;
margin:0;
padding:0;
border:0;
height:1200px;
}
</style>
</head>
<body>
<div class="content">
<img src="https://www.domaine.com/fb/images/image.jpg">
</div>
</body>
</html>
3. Open Facebook’s developer tools
The first step is to create an app in Facebook’s developer interface.
Sign in to Facebook and open facebook.com/developers.
If this was your first visit, Facebook asked you to authorize access. If you had already done that, you could go straight in.
4. Create the iFrame tab
Create a new app
In the developer interface, click ‘Create an App.’
The original illustration is no longer available.

Enter:
- An App Display Name, the name shown to users.
- An App Namespace for Open Graph use. The interface required at least eight characters, using letters, hyphens, and underscores.
Check ‘I agree to the Facebook Platform Policies’ and continue.

Complete the CAPTCHA and continue.

The new app’s page showed its App ID and App Secret. These values were used in the PHP template for conditional content. Keep the secret private. You also need the App ID to add the tab to your page later.
The edit control below the App Secret let you upload an icon displayed beside the tab name. The icon size used here was 16 × 16px.
Fill in the following fields:
Basic information
- App Display Name: The name entered earlier. This is the app name, not necessarily the tab name.
- App Namespace: The namespace entered earlier.
- Contact Email: The address Facebook should use to contact you.
- App Domain: Your domain, such as example.com.
- Category: Choose a category from the menu.

Website:
Enter your website URL.
Page Tab and App on Facebook
- Complete the App on Facebook section as illustrated below.
- Page Tab Name: The tab’s name on your Facebook page.
- Page Tab URL: The HTTP URL requested by the historical interface. Use the directory containing index.php or index.html, without adding the filename.
- Secure Page Tab URL: The corresponding HTTPS URL.

A detail worth checking:
The URLs in this setup pointed to the directory containing the index page:
https://www.example.com/facebook-tab/ rather than https://www.example.com/facebook-tab/custom-page.php.
Name the default page index.html or index.php.
Click ‘Save Changes’ to finish this step.
The original illustration is no longer available.
5. Add the iFrame tab to your Facebook page
The next step is simple once you know where to look.
Copy the code below and replace YOUR_APP_ID and YOUR_URL with the values from your app settings. YOUR_URL is the tab URL entered earlier.
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
Then choose the Facebook page where you want to add the tab:

Your tab is now on the page.
6. Bonus: a PHP template with different content for fans and non-fans
I offered a template through the Downloads tab on my Facebook page.
It was available through a Facebook tab that no longer works, so the file can no longer be downloaded there.
I hope that makes the steps easier to follow. Feel free to leave a question in the comments.




