A risk factor  is anything that increases a man’s chance of developing cancer. Although risk factors often influence the development of cancer, most do not directly cause cancer. Some people with several risk factors never develop cancer, while others with no known risk factors do. However, knowing your risk factors and talking about them with your doctor may help you make more informed lifestyle and health care choices.
The following factors can increase a person’s risk of developing penile cancer:
Human papillomavirus (HPV) infection. The most important risk factor for penile cancer is infection with this virus. HPV is most commonly passed from person to person during sexual activity. There are different types, or strains, of HPV, and some strains are more strongly associated with certain types of cancers. Reduce your risk of HPV infection by limiting the number of sex partners, because having many partners increases the risk of HPV infection. Using a condom cannot fully protect you from HPV during sex. HPV vaccines protect against certain strains of the virus. Learn more about HPV and cancer. 
Smoking. Smoking may contribute to the development of penile cancer, especially in men who are also infected with HPV. Learn more about quitting smoking .
Age. Penile cancer is most common in men older than 50. About 20% of the time, patients with penile cancer are younger than 40.
Smegma. Smegma is a thick substance that can build up under the foreskin and is caused by dead skin cells, bacteria, and oily secretions from the skin. Smegma may contain small amounts of cancer-causing substances. Uncircumcised men should pull back (retract) the foreskin and thoroughly wash the penis on a regular basis to make sure that smegma does not cause irritation of the penis.
Phimosis. Phimosis occurs when the foreskin becomes tight or constricted and is difficult to retract, therefore causing a buildup of smegma. Men with phimosis are less likely to be able to thoroughly clean the penis.
HIV/AIDS infection. Infection with human immunodeficiency virus (HIV), the virus that causes acquired immune deficiency syndrome (AIDS), is a risk factor. When a person is HIV-positive, their immune system is less able to fight off early-stage cancer.
Psoriasis treatment. Men who have been treated with the drug psoralen combined with ultraviolet (UV) light have a higher risk of developing penile cancer.
Circumcision. Circumcision may provide some protection from penile cancer because removing the foreskin helps keep the area clean. Epidermoid/squamous cell carcinoma of the penis almost never occurs in men who are circumcised. However, it is important to note that circumcision alone cannot prevent penile cancer.
Personal hygiene. Men who carefully and completely clean under the foreskin on a regular basis can lower their risk of developing penile cancer.
While it is not possible to completely prevent penile cancer, a man can lower his risk by not smoking, avoiding sexual practices that could lead to HPV or HIV/AIDS infection, and practicing good hygiene.