Charlotte Perkins Gilman wrote "The Yellow Wallpaper" based upon her own personal experience with postpartum depression (PPD). Gilman married Charles Walter Stetson, and after giving birth to their daughter, Gilman struggled with severe depression:
She consulted the noted neurologist S. Weir Mitchell, who prescribed his "rest-cure": complete bed rest and limited intellectual activity.
This is exactly the cure that our unnamed narrator receives in the story: not only at her husband's direction (he is a physician), but also from her brother (also a doctor). She noted:
I have a schedule prescription for each hour in the day; he takes all care from me...
She is not allowed to write—told that it is not good for her to use her mind (so she sneaks to do so). The prescription given to her, as well as the strict limitations placed upon her—her inability to leave her room and enjoy the gardens or the fresh air, etc.—do more damage than good. By the story's end, she has left reality, becoming enmeshed in the imaginary world of the people she "sees" in the yellow wallpaper.
Gilman credited [her own] experience with driving her ''near the borderline of utter mental ruin." The rest-cure served as the basis for [this short story.]
Ultimately, Gilman chose to remove herself from this treatment regimen. She also believed that her emotional difficulties were caused largely by the "confines of marriage" and she left Stetson. Gilman also wrote as a reaction to the general oppression of women in society who were believed to belong to their husbands; they could be found guilty of adultery, where husband were not (for the same behavior); they were refused the right to vote along with criminals and the mentally ill. They had no control over their lives, which is evident in Gilman's short story.
In 1926, she stated, regarding her work in general, 'One girl reads this, and takes fire! Her life is changed. She becomes a power—a mover of others—I write for her.'
Gilman's audience was originally women who had suffered—perhaps even questioned themselves—as she had. However, her modern audience is greater than she could have anticipated, providing insight not only to women who experience PPD, but also perhaps to husbands, doctors, and society in general.