The Motion Picture Production or "Hays" Code was in effect from 1930 until 1968 when it was replaced by the MPAA rating system. It wasn't really enforced until 1934, when the motion picture industry was pressured into policing itself to avoid boycotts and the threat of potential legal action.
The United States government, in this way, cannot be accused of every having censored any specific motion picture.
The Production Code enumerated three general principles as follows:
1. No picture shall be produced that will lower the moral standards of those who see it. Hence, the sympathy of the audience should never be thrown to the side of crime, wrongdoing, evil or sin.Specific restrictions were spelled out as particular applications of these principles:
2. Correct standards of life, subject only to the requirements of drama and entertainment, shall be presented.
3. Law, natural or human, shall not be ridiculed, nor shall sympathy be created for its violation.
Nakedness and suggestive dances were prohibited.See also: Tell Your Children
The ridicule of religion was forbidden, and ministers of religion were not to be represented as comic characters or villains.
The depiction of illegal drug use was forbidden, as well as the use of liquor, when not required by the plot or for proper characterization.
Methods of crime (e.g., safe-cracking, arson, smuggling) were not to be explicitly presented.
References to alleged sex perversion (such as homosexuality) and venereal disease were forbidden, as were depictions of childbirth.
The language section banned various words and phrases that were considered to be offensive.
Murder scenes had to be filmed in a way that would discourage imitations in real life, and brutal killings could not be shown in detail. Revenge in modern times was not to be justified.
The sanctity of marriage and the home had to be upheld. Pictures could not imply that low forms of sexual relationships are the accepted or common thing. Adultery and illicit sex, although recognized as sometimes necessary to the plot, could not be explicit or justified and were not supposed to be presented as an attractive option.
Portrayals of miscegenation (inter-racial marriage and procreation) were forbidden.
Scenes of passion were not to be introduced when not essential to the plot. Excessive and lustful kissing was to be avoided, along with any other treatment that might stimulate the lower and baser element.
The flag of the United States was to be treated respectfully, and the people and history of other nations were to be presented fairly.
The treatment of vulgarity, defined as "low, disgusting, unpleasant, though not necessarily evil, subjects" were to be "subject to the dictates of good taste." Capital punishment, "third-degree methods", cruelty to children or animals, prostitution and surgical operations were to be handled with similar sensitivity. - Wikipedia