"Page Not Found" when sharing on Facebook? Here's a quick fix.

Let's start with the fix before discussing what's causing it.

The Fix

  1. Copy the URL of the page that you want to share.
  2. Go to Facebook's URL Linter - https://developers.facebook.com/tools/debug/
  3. Enter the URL on the field provided and click the "Debug" button.
    It should give you the "Could not resolve the hostname into a valid IP address." error. If it doesn't, you might be encountering a different issue and this fix might not work.
  4. Click the "Fix new scrape information" button

You're good to go. The details (title, images, description, etc.) should now show up when sharing the URL.

The Cause

When sharing a newly-published blogpost or webpage on Facebook, it’s not unusual to encounter a 404 Error (Page not found).

Facebook runs a URL scraper that visits, gathers and indexes data of pages where the social plugins (like button, comment, etc.) are installed. When someone visits a URL with any of the social plugins, it triggers the Facebook to scrape information of that URL.

This shouldn't cause any problem if the URL is already published and is available to the public. But if it's a private URL, Facebook is greeted with the "404 Error" or "Page not found" of the site. That's the information it's able to scrape and index.

Facebook's index takes a couple of hours, maybe even days, to refresh. So even after publishing the page, sharing it will display the "404 Error" page and nothing relevant to the page. By using the URL Linter, you're manually asking Facebook to retrieve new information about the page.