# Plugin priority

**URL:** <https://forum.getkirby.com/t/plugin-priority/26838>\
**Category:** Questions\
**Created:** [October 25, 2022, 6:10pm UTC](https://forum.getkirby.com/t/plugin-priority/26838 "2022-10-25T18:10:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khepri.Design](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/khepri.design/32/13857_2.png) [@Khepri.Design](https://forum.getkirby.com/u/Khepri.Design)\
**Post date:** [October 25, 2022, 6:10pm UTC](https://forum.getkirby.com/t/plugin-priority/26838/1 "2022-10-25T18:10:46Z")

</div>

Hi there,

i am asking myselfe, how kirby handles the plugin priority. For example if f i have two similar plugins each with a file ‘snippets/my-snippet.php’ how to determine the priority?

greetings

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 25, 2022, 6:22pm UTC](https://forum.getkirby.com/t/plugin-priority/26838/2 "2022-10-25T18:22:34Z")

</div>

Plugins are loaded in the order they appear in the file system (if you want to enforce a certain loading order, you can manually number them…). If you need to load an extension after all plugins have been loaded, you can use the syste.loadPlugins:after hook.

> **[system.loadPlugins:after](https://getkirby.com/docs/reference/plugins/hooks/system-loadplugins-after)**
>
> Reference page for the hook system.loadPlugins:after

Snippets in the snippets folder with the same name as plugin snippets overwrite plugin snippets.

---

<div class="post-metadata">

**Author:** ![Khepri.Design](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/khepri.design/32/13857_2.png) [@Khepri.Design](https://forum.getkirby.com/u/Khepri.Design)\
**Post date:** [October 25, 2022, 7:15pm UTC](https://forum.getkirby.com/t/plugin-priority/26838/3 "2022-10-25T19:15:44Z")

</div>

Ah okey i see.  
so doing smth like this in the index.php of the plugin, will tell kirby, to load this after all plugins have been loaded?

```auto
Kirby::plugin('khepri-design/custom-extension', [
  'hooks' => [
    'system.loadPlugins:after' => function () {
      kirby()->plugin('khepri-design/custom-extension');
    }
  ]
. . .

```
