Cancer is a leading cause of death worldwide and according to the World Health Organization (WHO) accounted for 10 million deaths in 2020. Promising theranostic (therapy and diagnostic) agents in the treatment of cancer are nanomaterials, which have come to the forefront because of their small size approaching those of protein complexes in the human body, and of their easy functionalization giving access to nanocomposite materials with diverse functions (fluorescence, magnetic, stimuli‐responsiveness, etc.), and improved biocompatibility. Among them, affinity nanoparticles, often decorated with highly specific targeting ligands such as antibodies, aptamers, lectins and peptides, have enabled enhanced binding and exquisite recognition of biomarkers overexpressed in cancer cells. In this review, we describe an emerging class of targeting ligands, molecularly imprinted polymer hydrogel nanoparticles for their application in the early detection of disease, with the aim to improve diagnosis and treatment.