The Disappearing Data Problem in Facebook Sharer URLs
You are encountering a classic issue where the Open Graph meta tags on your target page override the parameters passed directly to facebook.com/sharer.php. When you construct a URL like http://www.facebook.com/sharer.php?p[title]=mytitle, Facebook's scraper prioritizes the content found at the destination URL (p[url]) over the inline parameters unless specific conditions are met.
The core conflict lies in how the Facebook Debugger and the actual sharing widget interpret the request. If your destination page contains <meta property="og:title" content="Actual Page Title">, that title will almost certainly be used instead of mytitle from your query string. This behavior is by design; it prevents spam from injecting titles into shared links while ensuring the sharer sees what their audience actually sees on the site.
However, there is a nuanced approach to forcing custom data if you control the destination page or if you are working within specific constraints. The solution depends entirely on whether you can modify the HTML of the page you are linking to.
Modifying the Destination Page vs. Query Parameters
The most reliable method to pass custom title, summary, and image data is to update the Open Graph meta tags directly in the <head> section of the HTML document at your specified URL. Facebook's scraper follows a strict hierarchy:
- Meta Tags: If present on the destination page, these take precedence.
- Query Parameters: Used only if specific meta tags are missing or if the parameter names match standard Open Graph properties (e.g.,
ufor URL,tfor title).
Your current implementation uses the older, non-standard query parameter syntax (p[title], p[summary]). While this works in some legacy contexts, modern Facebook sharing logic often ignores these unless the corresponding <meta> tags are absent on the target page.
To fix the issue where your data is "gone," you should inspect the destination URL using the Facebook Sharing Debugger. This tool simulates how the scraper sees the page. If the debugger shows the correct title but your code sends a different one, it confirms that the meta tags on your server are winning.
Implementing Custom Data via Meta Tags
If you cannot alter the destination page's HTML (for example, if you are sharing an external link to a site you do not control), you must accept that facebook.com/sharer.php will scrape the external content. There is no reliable way to force custom text on an arbitrary third-party domain using query parameters alone.
However, if you own the destination page, here is the correct implementation pattern:
<head>
<meta property="og:url" content="http://myurl.com/overview/sap-talent">
<meta property="og:title" content="Custom Title Here">
<meta property="og:description" content="Custom Summary Here">
<meta property="og:image" content="http://myurl/images/my_image.png">
</head>
Once these tags are in place, you can simplify your sharer link. You do not need to pass p[title] or p[summary] in the URL query string if the meta tags exist. The query parameters become redundant and can be removed:
<a id="button"
href="https://www.facebook.com/sharer/sharer.php?u=http://myurl.com/overview/sap-talent&pid=..."
target="_blank">
Share on Facebook
</a>
Note: The s=100 parameter and older p[...] syntax are largely deprecated. The modern API expects the u (URL) parameter for the link and relies on meta tags for content.
Handling Edge Cases and Trade-offs
There is a specific scenario where you might want to pass parameters directly without changing the HTML: when the page does not have Open Graph tags at all, or when you are testing in an environment that strips meta data. In this case, you can try using the legacy parameter names that Facebook still supports for fallback:
u: The URL of the content being shared.t: The title (overrides og:title if the page lacks it).s: The summary (overrides og:description if the page lacks it).p: The image (overrides og:image if the page lacks it).
Example fallback link:
<a id="button"
href="https://www.facebook.com/sharer.php?u=http://myurl.com/overview/sap-talent&t=mytitle&s=containsummary&p=http://myurl/images/my_image.png">
Share
</a>
Be aware that Facebook may still reject these if the content is deemed spammy or if the image does not meet their aspect ratio and size requirements. Always validate your links using the Facebook Sharing Debugger after making changes. Clearing the cache in the debugger is often necessary; clicking "Scrape Again" ensures you are testing the latest version of your page, not a cached snapshot.
Conclusion
The disappearance of your custom title and summary is likely due to Facebook's precedence rule favoring server-side meta tags over URL parameters. The robust solution is to ensure your destination page contains valid Open Graph meta tags matching the content you wish to share. If you cannot modify the HTML, be prepared that the scraper will use whatever content exists on the external domain, regardless of the parameters appended to the sharer URL.
