To access Facebook page timeline on your WordPress website, some plugins can ask for an ‘Access Token’ to get started. Here is a quick guide to generate a new access token.
1. Create a Facebook Developer Account:
- Visit the Facebook for Developers website.
- Log in with your Facebook credentials.
- If you don’t have a developer account, you’ll be prompted to create one.
2. Create a New App:
- Click on “My Apps” in the top-right corner and select “Create App”.
- Provide an App Name (e.g., “My Website Feed”) and your Contact Email.
- Choose “Other” in the Use Cases
- Choose “Business” as the app type and click “Next”.
- Click “Create App” and complete any security verifications if prompted.
3. Add the Necessary Products:
- In the App Dashboard, navigate to “Add a Product”.
- Locate “Facebook Login” and click “Set Up”.
- After setting up Facebook Login, go to “Settings” under “Facebook Login” in the left sidebar.
- In the “Valid OAuth Redirect URIs” field, enter your website’s URL (e.g.,
https://yourwebsite.com/). - Click “Save Changes”.
4. Generate Access Tokens:
- In the left sidebar, click on “Tools” and select “Graph API Explorer”.
- Ensure your newly created app is selected in the “Application” dropdown.
- Click on “Get User Access Token”.
- In the permissions window, select the necessary permissions such as
pages_show_list,pages_read_engagement, andpages_read_user_content. - Click “Generate Access Token” and authorize as prompted.
- Copy the generated access token.
5. Obtain the Page Access Token:
- In the Graph API Explorer, make a GET request to
/me/accountsusing your user access token. - This will list the pages you manage. Locate the page you want to display and note its
idandaccess_token. - Use this page access token for API requests related to that page.