Shakespeare was a leader in the anti-Chinese movement in the city. He became president of the Workingmen's Protective Association in 1878. The short-lived organization was established to lobby for restrictions on Chinese immigration during the 1878 election. Shakespeare's politics were popular in the Victoria of his day. He was elected mayor in 1882. He was also elected as a ConservativeMember of Parliament that year, defeating former B.C. Premier Amor De Cosmos in the Victoria district. Shakespeare was re-elected in 1887 but resigned his seat only three months later to become Postmaster for Victoria.