THEY were taxes raised from every pint of beer, ale or porter sold in Scotland during the early 1800s that paid for improvements to roads, harbour ports, schools and water supplies.

Now the Two Pennies Scots Acts, designed to fund good causes from bad habits, will be repealed after more than 200 years on the statute books as part of a major clearout of legislative deadwood and "meaningless provisions".

More than 800 laws will be swept away across the UK, including a 1322 Act on paying the king's debt using animals.

In Scotland, around 30 Acts will be repealed, including the tax on brewers which was last used in 1836, when tolerance of Scotland's emerging love of alcohol was running low. Official records show that, around this time, there were two-and-a-half gallons of spirits drunk per head of population each year.

The tax, which put two pennies Scots on every pint of beer sold – the equivalent of one- sixth of an old penny – was legislated in 16 areas of Scotland, including Edinburgh, Port Glasgow, Glasgow and Gorbals, Burntisland, Montrose and Aberbrothock – now Arbroath.

In Edinburgh, powers to collect the tax were toughened up given evasion of the levy, with a harder line taken on brewers selling to the garrison of Edinburgh Castle. In Port Glasgow and Newark, brewers exporting their ales by sea came under the alcohol tax.

In Glasgow and Gorbals, records show large sums of money had been borrowed ahead of the tax collection to carry out "useful public works" but it could not be repaid given poor collection rates. Penalties were introduced to breweries in the parish of Govan for importing ale without paying a charge with "a person to be employed to discover and seize contraband ale".

In Dundee, magistrates and town councils were allowed to advance money on the back of the beer tax to maintain public schools and secure a better water supply. Dalkeith saw the money used to pave and clean the streets with a new public market built.

The Scottish Law Commission has been working on the reforms with the Law Commission for England and Wales, with the repeals due to be approved by the UK Government in summer.

Sir James Munby, chairman of the Law Commission for England and Wales, said: "We are committed to ridding the statute books of meaningless provisions and making sure our laws are relevant in the modern world."

Other laws earmarked for repeal include an 1800 Act to hold a lottery to win the £30,000 Pigot Diamond, after its owners failed to sell it as its value, "the equal of any known diamond in Europe", was too great.

Also to be abolished is the Bail in Criminal Cases Act 1830, which sets the minimum period of delay between conviction and capital punishment. The time was set at 15 days for sentences handed down in Edinburgh and the south of the Firth and 20 days for sentences north of the Firth.

Executions were speeded up to secure "peace and quiet" during the 1820 insurrection and the economic depression that followed the Napoleonic Wars.

Some 40 Acts relating to the City of Dublin and passed by Parliament before Ireland was partitioned in 1921 will also be deleted, as will a 1696 Act to fund the rebuilding of St Paul's Cathedral after the Great Fire of 1666.

The demise of the Two Pennies Scots Act in the 1830s intersected with tougher rules on public houses, which were licensed for the first time under The Home Drummond Act of 1828.

However, this only affected legal drinking establishments, with illegal shebeens and dram shops keeping their hold on parts of society. At this time in Scotland, and up until the early 20th century, the legal age for buying alcohol was 14.