# Plug-in hook for note (specifically tags) changing

**URL:** <https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229>\
**Category:** Development\
**Created:** [July 5, 2022, 11:22pm UTC](https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229 "2022-07-05T23:22:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![radvendii](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/radvendii/32/10299_2.png) [@radvendii](https://forums.ankiweb.net/u/radvendii)\
**Post date:** [July 5, 2022, 11:22pm UTC](https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229/1 "2022-07-05T23:22:20Z")

</div>

I am making a plugin and would like to keep something in sync with the set of tags that exist. I found the `editor_did_update_tags` hook, but this doesn’t trigger in a lot of situations that a tag gets changed.

The most recent information I found was this thread: forums .ankiweb.net/t/propagating-tag-changes-to-the-sidebar-and-to-add-ons/3075\* from a few years ago that claims it wasn’t possible at the time but was being worked on. Has that changed? I still don’t see a way to do this.

In the absence of an officially sanctioned way of doing this, I was considering overriding `update_note` from `qt/aqt/operations/note.py`. Is there a reason there isn’t already a plugin hook called from that function?

UPDATE: I tested overriding `update_note()` and that doesn’t see all the changes to tags either. Is there any way to do this with modern Anki?

\*space included because apparently I haven’t earned the privilege of including links in my posts yet?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [July 8, 2022, 12:11am UTC](https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229/2 "2022-07-08T00:11:32Z")

</div>

The operation\_did\_execute hook can be used to observe when a tag was added or removed from the tag list, on when a note was modified. It is not possible to inspect what has changed; it is simply a notification that the UI needs updating, so if you need to handle specific changes, you’ll need to keep state and compare.

---

<div class="post-metadata">

**Author:** ![radvendii](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/radvendii/32/10299_2.png) [@radvendii](https://forums.ankiweb.net/u/radvendii)\
**Post date:** [July 11, 2022, 2:04pm UTC](https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229/3 "2022-07-11T14:04:38Z")

</div>

This suits my needs, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 3:15am UTC](https://forums.ankiweb.net/t/plug-in-hook-for-note-specifically-tags-changing/21229/4 "2023-05-01T03:15:09Z")

</div>


