Dave Heavy Industries Dave Heavy Industries – blog


Unable to post link to facebook

Strange one this morning. Our e-comm guys reported they were unable to post any links to their page, their own wall, other peoples walls... anywhere on facebook really. only "The message could not be posted to this Wall." was presented to them as an error.. useful??!?? I think not. After a bit of investigation, I found that it was some pages but not others. The home page for example worked, but a product would not. A content page would, but a category page would not. Ugh.

They all use the same template so I thought surely the html would be very similar... and it was. I ran the pages through the w3c validator, and made a bunch of unecessary changes to do with short-tags and pulled my hair out some more.

A few more coffees and some tweeting and googling brought to my attention that the error "The message could not be posted to this Wall." could be due to facebook blocking that url due to abuse... maybe one of our competitors complained to upset our social strategy? no - then all of the urls would be broken (only lost an hour here :| )

I went back to the HTML, removed anything fancy and it still didn't work. I decided not to let this get the better of me, and I went through the html line by line looking for anything out of the ordinary... and there it was.

Canonical link was missing a slash. <link rel="canonical" href="https:/somedomain.com" />. Now this was set by our e-commerce system, not by the template or development, and none of that has changed for a really long time, meaning that something at facebooks end has tightened up the validation. Anyway, not pointing fingers, commented it out and Posts are now sharing as expected. ugh.