Repairing broken links on this site

Whilst browsing the Google Search Console for this site I noticed that some of my older image galleries were returning errors. This gallery is run by 15 year old PHP code that I occasionally have to hack to keep running on newer versions of PHP so it was not a complete surprise that it might need some fixing. I should pay more attention to webserver upgrade notices though as the logs indicate it has been broken since 1st October.

The error was a bit puzzling at first:
PHP Parse error: syntax error, unexpected end of file
but eventually a helpful StackOverflow page made me realise that I needed to replace all instances of <? with <?php and the problem was solved.

During testing of the fix I found a more serious problem. All my links to picasaweb albums where I had hosted my photos from 2008 and 2009 were dead. This was unexpected since Picasa was run by Google and even though they replaced the service with Google Plus/Photos, I knew all my photos and albums were still online at the latest incarnation of Google’s service and I had trusted that Google, a company who place high importance on links for generating their search results, would not break links. It turns out that my trust was mis-placed as Google had broken some links but not others. Any link containing a username was broken but a userid would still work. So, if I could find my user id I could restore the links. Fortunately my Picasa user id turned out to be the same as my Google Plus user id, and because this was only a small number of posts over a 2 year period I could work through each one and replace the user name with that id to repair the link. There were a few direct links to photos that I was unable to repair because the URL did not contain my username.

These problems make me want to reconsider whether my current photo hosting solution with Flickr is the right one. While WordPress has improved since 2015, and has add-on features to make photograph-heavy websites go faster, those add-ons are still third-party integrations so these potential problems of what is known as “link rot” remain. I have recently been thinking about some of the other disadvantages of using WordPress, but I shall leave those for another post.

Leave a Reply