Download the PHP package sectsect/wp-tag-order without Composer
On this page you can find all versions of the php package sectsect/wp-tag-order. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wp-tag-order
WP Tag Order
Order tags independently in each posts (not site-globally) on WordPress with simple Drag-and-Drop ↕︎ sortable feature.

[!IMPORTANT] This plugin is NOT compatible with Gutenberg on WordPress 5.x. Consider using Classic Editor Plugin.
[!IMPORTANT] Mutation events will no longer be supported in Google Chrome and Edge in July 2024 (Google Chrome on July 23, 2024, and Microsoft Edge the week of July 25, 2024). As a result, WP Tag Order versions 3.6.0 or less will not work with Chrome v127 and later, which will be released on July 23, 2024.
You have to update to v3.7.0 or later.
If you still need PHP7 support, see Troubleshooting below.
See Chrome for Developers Blog for more details.
Get Started
-
Clone this Repo into your
wp-content/plugins
directory. - Activate the plugin through the
Plugins
menu in WordPress. - Go to
Settings
->WP Tag Order
page to select which taxonomies to enable ordering for.
Features
- 🏷️ Custom tag ordering for posts
- 🔍 Works with default WordPress tag and custom taxonomy systems
- 🔢 Drag-and-Drop interface for easy tag reordering
- 📊 Supports multiple post types and taxonomies
- 🔧 NEW: Programmatic Tag Order Management
- 🌐 NEW: REST API Support
- Retrieve ordered tags via GET endpoint
- Update tag order programmatically
- Supports authentication and permissions
- 🚀 Lightweight and performance-optimized
Notes
- When creating a new post, you need to save it once to enable tag ordering.
- To apply ordering to existing posts, "Add and Remove" any tag once.
- To bulk-update multiple posts at once, go to
Settings
->WP Tag Order
page and click 'Apply' under the Advanced Settings. - Tested on WordPress v6.3.1.
Requirements
- WordPress 5.6+
- PHP 8.0+
APIs
Function | Description |
---|---|
get_the_tags_ordered() |
Based on get_the_tags() - Codex |
get_the_terms_ordered() |
Based on get_the_terms() - Codex |
get_the_tag_list_ordered() |
Based on get_the_tag_list() - Codex |
get_the_term_list_ordered() |
Based on get_the_term_list() - Codex |
the_tags_ordered() |
Based on the_tags() - Codex |
the_terms_ordered() |
Based on the_terms() - Codex |
Usage Example
get_the_tags_ordered()
get_the_terms_ordered()
get_the_tag_list_ordered()
get_the_term_list_ordered()
the_tags_ordered()
the_terms_ordered()
Programmatic Tag Order Management
The plugin provides a Tag_Updater
class for developers to programmatically manage tag order:
This class allows flexible tag order updates directly from your theme or custom plugin code, supporting both array and string inputs with robust validation.
Return Value
update_tag_order()
returns: int|bool
int
: Meta ID if the tag order meta key didn't previously existtrue
: Successful update of existing metafalse
: Update failed or the new tag order is identical to the existing order
REST API
The WP Tag Order plugin provides two REST API endpoints for managing tag order:
Get Tag Order
- Endpoint:
/wp-json/wp-tag-order/v1/tags/order/{post_id}
- Method:
GET
- Parameters:
post_id
(required): The ID of the posttaxonomy
(optional): Taxonomy name (defaults to 'post_tag')
- Permissions: Publicly accessible
- Response: Array of ordered tags with full term details
Example Request
w/ cURL
Update Tag Order
- Endpoint:
/wp-json/wp-tag-order/v1/tags/order/{post_id}
- Method:
PUT
orPATCH
- Parameters:
post_id
(required): The ID of the posttaxonomy
(required): Taxonomy nametags
(required): Comma-separated list of tag IDs in desired order
- Permissions: Requires user authentication and post edit capabilities
- Response: Success status and message
Example Request
w/ cURL
Example Response
Authentication
- GET requests are publicly accessible
- PUT/PATCH requests require:
- User to be logged in
- User to have edit permissions for the specific post
- Post must be of an allowed type (default: 'post' or 'page')
For Developers
-
The ordered tag data is serialized and stored in the
wp_postmeta
table under keys likewp-tag-order-{taxonomy}
.meta_id post_id meta_key meta_value 19 7 wp-tag-order-post_tag s:91:"a:7:{i:0;s:1:"7";i:1;s:1:"5";i:2;s:2:"10";i:3;s:1:"4";i:4;s:1:"6";i:5;s:1:"8";i:6;s:1:"9";}";
- This Plugin does not hosting on the wordpress.org repo in order to prevent a flood of support requests from wide audience. Your feedback is welcome.
Troubleshooting
Still need support for PHP 7.
I have a branch php7 to support PHP 7 and End-of-Life for JaveScript Mutation events.
The branch will not be maintained anymore, so I recommend you migrate to PHP 8.
Change log
See CHANGELOG file.
License
See LICENSE file.
✌️
A little project by @sectsect