use wp function for reduce querie