AO3 Tag Reorder

Rearrange tag order when editing a work or bookmark

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Forfatter
Ifky_
Daglige installasjoner
0
Totale installasjoner
48
Vurderinger
3 0 0
Versjon
1.1.0
Lagd
26.01.2025
Oppdatert
10.07.2025
Size
16 kB
Lisens
GPL-3.0-only
Gjelder

Tag Reorder

Demo of reordering tags by dragging and dropping them in place

About

This is a script meant to reorder a work's tags (Fandoms, Relationships, Characters, Additional/Freeform) for Archive of Our Own (aka AO3). To reorder the tags, just drag and drop a tag somewhere else in the list.

It is also possible to sort bookmarker's tags on a bookmark. Note which URLs activates the script, using the @match URLs in the script. In order to easily separate work tags and bookmark tags, reordering bookmark tags only works on pages with "bookmarks" in the URL, e.g. /bookmarks/123 or /users/username/bookmarks.

Normally, when removing and adding tags to change their order, existing tags will not be updated in the AO3 database. Only deleted tags will be removed, and new tags will be appended at the end of the tag list. It does not care if the existing tags have changed order. This makes reordering existing/new tags tedious. This script solves the issue by sending two network requests: one with empty tags and one with the user's list of tags. (All empty with the exception of fandom, which will have a "-" (dash) placeholder fandom, which is used because the fandom category is a required field and cannot be completely empty. It is automatically replaced with the real fandom tags in the second request.) That way, in the second request, all tags are saved in the order they are in the list.

Note: This script is generally secure and stable, but due to the possibility of network issues or being rate limited by AO3, there is a potential risk of the first request being sent without the second. In that case, the work will be saved with no tags. Copy the tags beforehand to keep a backup.

Functionality

Copying Tags

The tags can be copied to the clipboard either by category or all tags at the same time. The recommended way is to copy all at the same time, so that no category is forgotten. Paste the comma separated list in a text file for safekeeping.

In the event that the reordering of tags fails, the tags will be left empty. The tags can easily be pasted back in. AO3 will separate each tag by comma. This must be done separately for each category (fandom, relationship, character, additional/freeform).

Info Button

A button for opening an information modal has been provided, for easily available instructions in the UI itself.

Save Buttons

In order to reorder the tags, new buttons have been inserted at the bottom of the form. If reordering the tags is unnecessary (or you have only reordered new tags), use AO3's standard buttons ("Save As Draft", "Preview", "Post", etc.) and it will function as normally (even if the tags have been reordered).

If reordering tags is wanted, use the buttons inserted by the script ("Save tags"). It's possible to save as draft (if the work can still be drafted) or post.

For works with no pre-existing tags (e.g. new works), the standard buttons and the script's buttons work the same. Due to this, the buttons have been removed on the "new work" page in order to avoid any complications of trying to update a work that technically does not exist yet.

Style

Elements have been styled minimally and with the intention that it should fit different site skins, but if it does not, here are the selectors to adjust them:

  • The "information" sections can be selected with #tag-copy-list-freeform where "freeform" can be replaced with the name of the other categories (fandom, relationship, character).
  • The buttons can be selected with button elements.
  • The tag handles ("hamburgers"/three lines) can be selected with .freeform .added.tag::before where "freeform" can be also replaced with the name of the other categories (fandom, relationship, character).

It's also possible to edit in the code, but any changes to the script risks being overridden if the script is updated.

Script Dependencies

  • Alpine.js v3.14.8

FAQ

  • Q: I'm using Greasemonkey. Why isn't it working? A: Try using the Tampermonkey extension instead.