The play opens with a party at the Chiltern house, where all the major characters are introduced. At this party, Mrs. Cheveley blackmails Sir Robert and forces him to support her Argentine Canal scheme, in which she has invested heavily. She has in her possession a letter he wrote early in his public career in which he sold state secrets for a great fortune that has supported him to this day. Faced with certain ruin, Sir Robert has no choice but to accept Mrs. Cheveley's terms, and agrees to go before the House of Commons and publicly support the canal. Later in the night, Lady Chiltern, who prides herself on having an "ideal husband" and is unaware of Sir Robert's prior corruption, appeals to his morality and forces him to write a letter retracting his promise to Mrs. Cheveley. Toward the end of the act, Lord Goring and Mabel Chiltern discover a seemingly misplaced diamond brooch that Goring recognizes as something he gave to someone long ago. Lord Goring keeps the brooch and tells Mabel to inform him if anyone asks for it.
In Act II Lord Goring and Sir Robert discuss his plight, and Sir Robert relates why he sent the letter to Baron Arnheim, selling the state secret, so many years ago. Lord Goring suggests Sir Robert should reveal his immoral deed to Lady Chiltern, but he cannot fathom disappointing her and shattering her perfect image of him. Instead, Sir Robert wires to Vienna seeking information on Mrs. Cheveley, hoping to uncover something he can use to fight against her blackmail. Lady Chiltern enters and Sir Robert escapes rather quickly. Lord Goring talks with Lady Chiltern, trying to see how she might react upon learning of Sir Robert's indiscretion. Lady Chiltern holds her husband in the highest regard and does not believe him capable of corruption. Lord Goring warns Lady Chiltern that she has rather harsh views, and that life must be lead with love rather than judgment.
After Lord Goring departs, Lady Markby and Mrs. Cheveley visit. Mrs. Cheveley lost a diamond brooch at the Chiltern's party and asks if it has been found. The women chat for a brief while, and then Lady Markby departs to make a quick visit to a nearby friend. Left alone, Lady Chiltern and Mrs. Cheveley exchange heated words. Mrs. Cheveley reveals Sir Robert's past just as he enters the room to find his wife and his blackmailer together. He orders Mrs. Cheveley to leave, and she complies only after threatening him again. Lady Chiltern begs Sir Robert to deny Mrs. Cheveley's accusations, but he does not, and finally tells her the truth about his past. She recoils from him in despair, her ideal image of him shattered. The act closes with a tirade in which Sir Robert curses how women put men upon impossible pedestals. He tells his wife she has ruined him, and storms out. Lady Chiltern, in great pain, tries to follow, but finds her husband gone.
At the opening of Act III Wilde introduces Phipps, the Ideal Butler, and describes the scene inside Lord Goring's house where he and Phipps discuss the relevance of his buttonhole as Goring prepares to head out for the evening. Goring receives an unexpected letter from Lady Chiltern urgently stating that she wants him, needs him, and is coming to him. Surprised, he prepares for her arrival. However, Lord Caversham suddenly arrives and is determined to talk about the direction of his son's life. Lord Goring discreetly tells Phipps that he expects a lady visitor and to bring her into the drawing room if she arrives when Lord Caversham is still visiting. A lady does appear, but it is Mrs. Cheveley rather than Lady Chiltern. Phipps does not know who was expected and assumes Mrs. Cheveley is the visitor Lord Goring spoke of. While waiting to be taken into the drawing room, Mrs. Cheveley finds Lady Chiltern's letter to Lord Goring and tries to steal it, but does not have the opportunity.
Sir Robert arrives after Lord Caversham leaves and begs Lord Goring for help. He is in a desperate state, and wants advice. Just as Lord Goring is about to escort his friend out, a chair falls in the drawing room, and Sir Robert wants to know who has been listening. Lord Goring tries to keep him from seeing who is in the room, for he believes Lady Chiltern occupies it. Sir Robert finally manages to get into the room, and when he sees Mrs. Cheveley he leaves the house in disgust. Lord Goring is completely surprised when he realizes Mrs. Cheveley was in the drawing room rather than Lady Chiltern. They begin talking, and Mrs. Cheveley tries to convince Lord Goring to marry her by offering to give him Sir Robert's letter in return. He refuses the offer and tells her she has desecrated the idea of love, and for that she is beyond forgiveness. Lord Goring shows Mrs. Cheveley the brooch he found at the Chiltern party, and she explains that it is hers and that she misplaced it. Knowing the origin of the brooch, Lord Goring accuses her of stealing it from his cousin Lady Berkshire, whom he gave it to. She denies the theft, but the brooch is in fact a bracelet with a hidden clasp and after Lord Goring clamps it onto her arm, Mrs. Cheveley cannot remove it. Lord Goring threatens to call the police if Mrs. Cheveley does not give him Sir Robert's letter. Beaten in her own game, Mrs. Cheveley hands over the letter, but before angrily leaving his house, secretly steals Lady Chiltern's urgent letter when Lord Goring is not looking.
In Act IV Lord Caversham informs Lord Goring of Sir Robert's speech denouncing the Argentine Canal scheme. All the papers are praising Sir Robert. Shortly thereafter, Lord Goring proposes to Mabel Chiltern, and she accepts him. Then, he tells Lady Chiltern that Sir Robert is safe, because he has possession of the letter to Baron Arnheim. However, he warns her that Mrs. Cheveley has the letter Lady Chiltern had sent to him the previous night, and plans to send it to Sir Robert. The two plan to intercept the letter before it reaches him. However, Sir Robert soon bursts into the room with the letter in hand, believing his wife had written it to him directly. She plays along and he is overjoyed. The two reconcile, and Sir Robert agrees that he must now leave the field of politics due to his disgraceful beginnings. Lord Caversham enters with the news that Sir Robert has been offered the empty cabinet seat. Although tempted, he declines the offer because he believes his wife wants him to retire from public life. However, Lord Goring convinces Lady Chiltern to urge her husband to accept the empty seat, as forcing her husband to abandon his profession will not lead to a happy life or marriage. Finally, with his wife's encouragement, Sir Robert accepts the position. Lord Goring informs the group that he intends to marry Mabel, but Sir Robert refuses permission based on Mrs. Cheveley's presence at Lord Goring's house the previous night. Lady Chiltern admits that it was she that Lord Goring expected, and that the letter Sir Robert believes to be his was written to Lord Goring. Sir Robert understands, forgives his wife for not revealing this to him immediately, and gives permission for the marriage. The play ends with Lady Chiltern proclaiming a new beginning.