Loop – Remove filter by post_order and then add it back

To add a removed filter back you need to know what was originally installed in the first place. you can crawl global $wp_filter array, but it should do the same with very little effort:

function remove_query_order($order) {
  return '';

Add the filter before the query you want it to take effect and it will remove itself.

Leave a Comment