I am using the Facebook "Like Button for the Web" tool to generate a like button on my WordPress web page. The generated code inserts the like button but when I click the button, I am getting an error in the console:
Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'deny'.
Generated IFrame code
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.perofamilyfarms.com%2Fpepperday%2F&width=72&layout=button&action=like&size=large&share=false&height=65&appId" width="72" height="65" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
This worked previously but I haven't checked it in a while.
src="...&height=65&appId"
- I don't think theappId
parameter should be empty. I am not sure if Facebook added any restrictions regarding like buttons recently, but it could be that they limit this to use on the domains configured in the app settings now. Try to remove the empty parameter, and if that does not help, add an actual app id, of an app that has the site you are using this on configured in app domains and website platform.