Because the best chlamydia tests look directly for evidence of the organism, rather than for an immune response against it, testing for rectal chlamydia requires that the anus be swabbed. Unlike a urethral swab, a rectal/anal swab causes minimal discomfort in most individuals, and research shows that swabs can even be effectively taken by patients themselves - although this is not yet an accepted standard of care. Once the sample is taken, the swab can be tested for chlamydia trachomatis, just as would be done at any other anatomic site.
If you are a man, or woman, who practices unprotected receptive anal sex, consider discussing with your doctor whether rectal STD testing - including both gonorrhea and chlamydia tests and an anal pap may be a right for you. Although rectal chlamydia trachomatis infections are not often discussed, or tested for, they may be a real problem. A 2009 study of HIV positive gay men in Switzerland found that more than 10 percent had rectal chlamydia infections. A similar prevalence of rectal chlamydia infection was found in an Amsterdam based study of men and women who reported receptive anal intercourse.
Dang, T. et al. (2009) "High Prevalence of Anorectal Chlamydial Infection in HIV-Infected Men Who Have Sex with Men in Switzerland" Clinical Infectious Diseases 2009; 49. E-Pub Ahead of Print. Accessed 11/1/09. van der Helm J.J. et al. (2009) "High performance and acceptability of self-collected rectal swabs for diagnosis of Chlamydia trachomatis and Neisseria gonorrhoeae in men who have sex with men and women." Sex Transm Dis. Aug;36(8):493-7.