🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

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!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

نووسەر
Ifky_
Daily installs
0
Total installs
38
Ratings
3 0 0
وەشان
1.1.0
Created
2025-01-26
Updated
2025-07-10
Size
16 KB
مۆڵەت
GPL-3.0-only
Applies to

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 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. The script has not added the functionality to reorder tags for preview. While it is possible to add preview of reordered tags, it was decided against due to lack of usefulness.

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 udpate 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 each have an ID, in the form of tag-copy-list-freeform where "freeform" can be replaced with the name of the other categories (fandom, relationship, character).
  • The buttons can be styled as button elements.
  • The tag handles ("hamburgers"/three lines) have selectors in the form of .freeform .added.tag::before where "freeform" can be 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.