In the summer of 1893, Oscar Wilde began writing An Ideal Husband, and he completed it later that winter. At this point in his career he was accustomed to success, and in writing An Ideal Husband he wanted to ensure himself public fame. His work began at Goring-on-Thames, after which he named the character Lord Goring, and concluded at St. James Place. He initially sent the completed play to the Garrick theater, where the manager rejected it, but it was soon accepted the Haymarket Theatre, where Lewis Waller had temporarily taken control. Waller was an excellent actor and cast himself as Sir Robert Chiltern. The play gave the Haymarket the success it desperately needed. After opening on January 3, 1895, it continued for 124 performances. In April of that year, Wilde was arrested for 'gross indecency' and his name was publicly taken off the play. On April 6, soon after Wilde's arrest, the play moved to the Criterion Theatre where it ran from April 13-27. The play was published in 1899, although Wilde was not listed as the author. This published version differs slightly from the performed play, for Wilde added many passages and cut others. Prominent additions included written stage directions and character descriptions. Wilde was a leader in the effort to make plays accessible to the reading public. In 1897, he wrote a letter describing the process of writing An Ideal Husband, which was later published under the title De Profundis.
The play borrows from the style of Alexandre Dumas, where a theatrical device, in this case a letter, determines the outcome. Yet, Wilde keeps his work original by creating constant ironic plot twists and turns. The plot of An Ideal Husband was largely influenced by events in Paris in 1893. The directors of the Compagnie du Canal Interoceanique exploited shareholder funds, and similar political corruption lies at the heart of Wilde's play. In addition, some critics suggest that the play borrowed elements of mark Twain's The Gilded Age, and that the character of Sir Robert Chiltern might be modeled after two contemporary politicians: Sir Charles Duilke, a dining friend of Wilde's, or Charles Stuart Parnell. Sir Charles was the Liberal Party's Under-Secretary of Foreign Affairs from 1880 to 1882 and President of the Local Government Board from 1882 to 1885, but his career suddenly ended in 1885 when his wife divorced him. Parnell was accused of political murder, but was acquitted. Soon after he was named in divorce proceedings and withdrew from public life.
An Ideal Husband is one of the most serious of Wilde's social comedies, and contains very strong political overtones, ironically and cynically examining the contemporary political landscape. The play's main focus is the often corrupt sources of great wealth, of which the public is usually ignorant. The characters and circumstances surrounding Sir Robert, Mrs. Cheveley, and Baron Arnheim all mirror contemporary society and how finances increasingly influence political life. Within this political realm, the play notes how social power relies not on money, but rather on information and knowledge. In the play, secret knowledge allows Mrs. Cheveley to hold great power over Sir Robert Chiltern.
The play's action discusses and analyzes conflicts between public and personal morality, and examines the power of self-interest. Although Sir Robert is only honest when it is in his interest, Lady Chiltern, for all her talk of honor and morality, is often hypocritical in her inability to forgive others. The play does not contain a formula for public success, and Wilde maintains a very critical view of society. In the play, Wilde also examines the problematic nature of marriage, and portrays it as corrupt and corrupting. The Chilterns are foolish to try to have an "ideal" marriage based on materialistic values, such as property and high social standing. Wilde suggests a similarity between the absences of morality in their marriage and the lack of morality in the state's political/governing body.
Wilde crafts his characters as works of art, and demonstrates how their culture has taught them to behave with a certain amount of pretense. The play constantly moves toward a more ideal moral standard as the characters struggle with dishonesty, hypocrisy, double moral standards, materialism, and corruption of social and political life. Wilde's enduring message is that love, and not wealth, leads to happiness.