🔥 Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer →
Account Get it free
Sort Query Posts icon
Possibly abandoned Tested up to 3.4.2 #1 in order_by

Sort Query Posts

A really simple and lightweight plugin (73 lines of code – comments included) to sort posts on-the-fly without making a new query to the database (improves performance).

Active installs100+100+ tier
Downloads · 30d137▲ +50.5% vs prev. 30d
Rating5/53 reviews
Health score32/100At risk
All-time downloads12.5KSince Jan 2011
Support resolved—No recent threads
RequiresWP 2.5PHP any
Downloads · 7d49▲ +69% week over week
Our verdict

Consider an alternative

Sort Query Posts shows warning signs in 2026 — compare the alternatives below before installing. It runs on 100+ sites, is rated 5/5 and was last updated 14 years ago, and scores 32/100 on our health check.

  • Small user base (100+ active installs)
  • Very few reviews so far
  • No update in 14 years
  • Only tested up to WordPress 3.4 (latest is 7.1)

Daily downloads

3711Sep 4Oct 18Dec 2
Yesterday15
Daily average (1y)2
Peak day15Dec 2, 2026
Last 12 months723

Download spikes usually follow a new release — each site that auto-updates counts as a download.

Rankings

Where Sort Query Posts stands today

WordPress.org search rankings

Live position in the plugin search, top 100
KeywordPositionCompeting pluginsCategory
order_by #50 59 Best order_by plugins →
post >100 10,000 Best post plugins →
query >100 10,000 Best query plugins →
reorder >100 1,653 Best reorder plugins →
sort >100 3,308 Best sort plugins →

Version adoption

Share of active sites per release.

  • 1.1100.0%

Rating breakdown

★★★★★★★★★★ 5 from 3 reviews

  • 5★100.0%
  • 4★0.00%
  • 3★0.00%
  • 2★0.00%
  • 1★0.00%

About Sort Query Posts

From the official readme · v1.1

Description

A really simple and lightweight plugin (73 lines of code – comments included) to sort posts on-the-fly without making a new query to the database (improves performance).

Features:

  • Supports all order_by and order values of the query_posts function except meta_value and meta_value_num (which require a database query).
  • Supports changing the order of all types of posts, including custom post type posts and custom post type “archive” posts.

Documentation

This plugin adds the function sort_query_posts_by(string $order_by [, string $order]) to the global context.
The second $order parameter is optional. Its default value is asc (ascending order).

Call this function before the loop to change how posts are ordered.
After calling this function you can show the posts as you normally would.

You can sort posts by:

  • author
  • comment_count
  • date
  • id
  • menu_order
  • modified
  • parent
  • title

This is specially useful in two cases:

  • When you need to reorder the posts returned by the query that WordPress creates from your given URL. Custom post type “archive” posts are a great example of this case.
  • When you need the posts returned by your customized query (e.g. query_posts()) to be shown more than once on the same page and ordered differently.

Examples:

<?php sort_query_posts_by('title', 'desc'); ?>

The example above will sort posts by their title in descending order without making a new query to the database.
This way sorting is performance friendly.

<?php sort_query_posts_by('ID'); ?>

The example above will sort posts by their ID in ascending order.

<?php sort_query_posts_by('rand'); ?>

The example above will sort posts randomly. When sorting randomly $order is ignored.

Plugin developed by Túbal Martín at www.margenn.com.

Installation

  1. Upload sort-query-posts folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use the added function sort_query_posts_by after any wordpress query and your posts will be sorted to your needs.

Changelog

1.1

  • Code refactored for improved performance. Updating is recommended.

Full changelog on WordPress.org →

For developers

Is this your plugin? Show off the numbers.

Add a live badge to your site, docs or GitHub README. It updates on its own — no account needed.

Active installs badge Rating badge Health score badge

FAQ

Sort Query Posts: quick answers

Straight answers, pulled from live WordPress.org data.

Source: WordPress.org

Is Sort Query Posts free?

Yes. Sort Query Posts is free to download and use from the official WordPress.org plugin directory.

Is Sort Query Posts safe to use in 2026?

Sort Query Posts shows warning signs in 2026 — compare the alternatives below before installing. It runs on 100+ sites, is rated 5/5 and was last updated 14 years ago, and scores 32/100 on our health check.

How many websites use Sort Query Posts?

Sort Query Posts is active on 100+ WordPress websites and has been downloaded 12,495 times since it launched in January 2011. It was downloaded 137 times in the last 30 days.

Does Sort Query Posts work with WordPress 7.1?

Sort Query Posts is officially tested up to WordPress 3.4.2, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

When was Sort Query Posts last updated?

The latest version, 1.1, was released on September 4, 2012 (14 years ago).

Who makes Sort Query Posts?

Sort Query Posts is developed and maintained by Tubal.

Powered by PageForge

One template and a spreadsheet. A real page for every search.

PageForge turns each row of a CSV into a WordPress page with its own title, URL, SEO fields and schema, built on the layout you already designed. Free on WordPress.org.

  • CSV and XLSX, plus Google Sheets on Professional and Enterprise
  • Its own title, URL, SEO fields and schema for every page
  • Works with the block editor, Elementor, Divi and Avada
  • Free on WordPress.org, no credit card

↑↓ to move↵ to open