Author Mark Forsyth was writing his book in the library, and needed to check a line from the famous play.
The British Library said the fault was caused by a newly installed Wi-Fi service from a third-party provider.
One security expert said the incident highlighted the "dysfunction" of Internet filters.
Forsyth said on his blog that the filter had logged his attempt to access the page.
A spokesperson for the British Library told the BBC that Hamlet had since been made accessible.
"The upgraded service has a web filter to ensure that inappropriate content cannot be viewed on-site," he added.
"We've received feedback from a number of users about sites which were blocked, but shouldn't have been. We're in the process of tweaking the service to unblock these sites."
Internet filters have recently come under increased scrutiny, after the government announced that pornography will be automatically blocked by UK Internet providers, unless customers choose otherwise.
Digital rights activists raised concerns about the move, fearing that the lists of "banned" sites could be expanded to include pages that should be publicly available.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.