# Is there a alternative for autoID plugin?

**URL:** <https://forum.getkirby.com/t/is-there-a-alternative-for-autoid-plugin/30161>\
**Category:** Questions\
**Tags:** v4\
**Created:** [December 1, 2023, 12:31am UTC](https://forum.getkirby.com/t/is-there-a-alternative-for-autoid-plugin/30161 "2023-12-01T00:31:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [December 1, 2023, 10:38am UTC](https://forum.getkirby.com/t/is-there-a-alternative-for-autoid-plugin/30161/3 "2023-12-01T10:38:34Z")

</div>

about moving from autoid to uuids:

> [@Migration Autoid to Kirby UUIDs](https://forum.getkirby.com/t/migration-autoid-to-kirby-uuids/28212):
>
> If anybody wants to migrate from kirby-autoid to native UUIDs this worked quite well for me. \<?php return ['description' =\> 'Autoid\>uuid bruteforce replacer', 'args' =\> [], 'command' =\> static function ($cli): void { $index = site()-\>index(); $replacements = 0; foreach($index as $autoidPage) { if($autoidPage-\>autoid()-\>isNotEmpty()) { $autoid = $autoidPage-\>autoid()-\>value(); foreach($index-\>not($autoidPage) as …

and there is a thread in discord on how to create custom uuid for structures. BUT no solution for duplicating entries!

> **[Discord - A New Way to Chat with Friends & Communities](https://discord.com/channels/525634039965679616/1088408228452384852)**
>
> Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

code is based on work done by @pedroborges

**site/plugins/structuuid/index.php**

```php
<?php

use Kirby\Cms\App as Kirby;

/*
 myStructure:
    type: structure
    fields:
      uniqueId:
        type: structure-uuid
 */

Kirby::plugin('bnomei/unique-ids-for-structures', [
    'fields' => [
        'structure-uuid' => [
            'computed' => [
                'value' => function () {
                    return $this->value ?? uuid();
                },
            ],
        ],
    ],
]);

```

**site/plugins/structuuid/index.js**

```js
panel.plugin('bnomei/unique-ids-for-structures', {
  fields: {
    'structure-uuid': {
      template: '<template></template>',
      mounted() {
this.$el.parentElement.parentElement.remove()
      },
    }
  }
});

```

---

_[View the full topic](https://forum.getkirby.com/t/is-there-a-alternative-for-autoid-plugin/30161)._
