The present invention discloses a filter in an aquarium or a garden pond for removing dirts adsorbed in pores by extruding and releasing a filter cotton, including a central axial column arranged on a barrel cover of the filter, a filter cotton sleeving the central axial column via a central hole of the filter cotton to enable the filter cotton to rotate around the central axial column, and a blocking bar axially arranged at an outer side of the filter cotton, wherein the filter cotton is extruded between the blocking bar and the central axial column; upper and lower connecting plates are respectively arranged above and below the filter cotton, and respectively sleeve the central axial column; shifting forks are further connected between the upper and lower connecting plates, and pass through eccentric holes of the filter cotton; a gear plate is further fixed on the upper connecting plate, and sleeves the central axial column; the barrel cover is provided with a handle or a motor; a lower end of the handle or a shaft of the motor is provided with an actuating gear which is meshed with the gear plate, so that the handle or the motor drives the gear plate to rotate via the actuating gear, and the gear plate drives the shifting forks to actuate the filter cotton to rotate, thereby achieving an effect of cleaning the filter cotton. The filter has characteristics of reliable rotation and complete cleaning.