Suppressing the slave trade
In 1839 Denman took command of the West Africa Squadron's brig-sloop, HMS Wanderer. On 5 April 1840, the Wanderer's boats seized the American slaver Eliza Davidson, which was subsequently condemned in British and Spanish Mixed Commission Court at Sierra Leone. On 12 May, Denman took the Josephina, a Portuguese schooner fitted for the slave trade, as a prize. On 3 June, he took the schooner São Paolo de Loando as prize. On 9 June he took another schooner fitted for the slave trade, the Maria Rosaria. On 3 July he took the Pombinha, out of Havana, and fitted for the slave trade; on 29 December 1842, a prize court awarded Wanderer's crew a tonnage bounty and moiety of proceeds for Pombinha.
In 1840, while negotiating for the release of two Britons, Denman also negotiated a treaty abolishing the slave trade in the territory of the Gallinas, liberating 841 slaves. At the same time, he destroyed the barracoons (large slave-holding depots) on the banks of the river. The Admiralty initially praised his actions and promoted him to Captain in August 1841, and he left Wanderer on 23 August. Lord Palmerston stated, "Taking a wasp’s nest…is more effective than catching the wasps one by one". However, the Spanish slavers sued him personally for damages. By 1842 the Admiralty had banned the anti-slavery squadron's policy of blockading rivers and the destruction of property. For his role in this action, Denman, his crew and others later received a Parliamentary grant, in Denman's case of over £558.
On his return to England, Denman was on half-pay, awaiting the outcome of the court case. He was active, writing a manual for the squadron, called Instructions for the Guidance of Her Majesty’s Naval Officers Employed in the Suppression of the Slave Trade, which was to be issued to every serving officer. Captain Joseph Denman has been described as one of the most successful and passionate officers to serve on the West Africa squadron and he has been credited with improving the efficiency of the squadron more than any other serving officer. In 1848 the court reached a final decision in the case Burón vs. Denman, one of the last cases in English & Welsh law to regard slaves as property or cargo, finding in Denman's favour as he had been operating as an agent of the British state's policy of suppressing the slave trade when he "trespassed to goods" when destroying the barracoon, rather than as an individual, and therefore his actions fell under the Crown act of state doctrine.