This present invention relates to the technical field of a cockroach trap, and provides a vertically collapsible or horizontally collapsible cockroach trap, which includes an upper trap body and a lower trap body that are vertically extensible and retractable and interconnected to each other, where an inner cavity is formed between the upper trap body and the lower trap body, an adhesive sheet used to bond cockroaches, a cockroach attractant, and an anti-adhesion structure used to prevent bonding between the adhesive sheet and an inner wall of the inner cavity are disposed in the inner cavity, and an entrance available for cockroaches to enter the inner cavity is disposed on the upper trap body or the lower trap body. The anti-adhesion structure is applied to the vertically collapsible or horizontally collapsible cockroach trap, which avoids that the upper trap body and the lower trap body are hardly vertically extensible and retractable due to bonding of the adhesive sheet. During use, by vertically extending the upper trap body and the lower trap body, the inner cavity is expanded, and the entrance is opened, and cockroaches are tempted to enter the inner cavity and are then bonded by the adhesive sheet, which avoids a problem that a hand may touch the adhesive sheet and the cockroach attractant during use, which is very unsanitary, and avoids a problem that a cardboard needs to be folded manually into a cockroach trap, which is time-consuming and troublesome.