Is it possible to automatically number blog posts, both current and future?

Question:
Is it possible to automatically number blog posts, both current and future?
Product:
I’m currently working on wix Editor and Wix Developer

What are you trying to achieve:
I want all the posts of my blog to be attributed a sort of ID. If possible I could search a post by typing the Id on the search Bar

Just add it as a hashtag or within the blog post content. The search bar should pick it up.

1 Like

A. Posts already generate their own unique _id field consisting of a random string with 24 hexadecimal characters
B. If you want an auto-incrementing number field, you’ll need to implement that using beforeInsert

1 Like

Sorry, I don’t really get your answer, did I misunderstand their question?

Some people use Wix Blog to create posts that are more like a knowledge base. So they use numbers like …. “Article 5555, How to prepare something”, “Article 5556, How to do the next Step”, etc.

So when a visitor searches the posts, they usually search by an article number instead of a title or keywords.

Which, now that I think about it —— they could also just add that number to their blog post title as well.

Okay, that is one more thing I’ve learned, thank you

that is true…but how do I proceed if i am already at 300 articles and i forgot to number all of them? Do I have to edit them one by one manually ?

Unfortunately, I think one by one is the only way.

You can create a backend function that fetches all your blog posts, then iterates them and adds the incrementing number to each

Then, in the editor, you can run it manually