Also, ich werde das jetzt mal auf Englisch beschreiben, da dieses Forum auf Englisch zu halten ist, aber das kannst du ja.
You have the following possibilities to solve your issue:
-
You edit manually the wrong entries inside of your database, clicking onto the corresponding TAG-FIELD and remove the wrong entry and type it in again including the right value.
-
You generate some code (function) which will do this job for you → scanning your database for wrong or similar entries → editing or removing them. → 1-click-solution → meaning the whole correction-process will be processed just by one click in seconds, scanning your entire database and removing alsmost identical (wrong) entries in your database.
How to do so ? NOW PAY ATTENTION → YOUR LEARNING MOMENT !!!
- Navigate to → JS-FIDDLE —> https://jsfiddle.net/
- Put my example code to the JS-SECTION of the JS-Fiddle-Editor…
function filterCorrectSpellings(words, correctWords) {
return words.filter(word => correctWords.includes(word));
}
// Example usage:
const wordsToFilter = ['apfel', 'apfel', 'bannane', 'banane', 'banan', 'banane_'];
const correctWords = ['apfel', 'banane'];
const correctSpellings = filterCorrectSpellings(wordsToFilter, correctWords);
console.log(correctSpellings); // Output: ['apfel', 'apfel', 'banane', 'banane']
Will look like…
-
Run the shown code…

-
Pay attention on to the OUTPUT inside the CONSOLE…

-
In this example i have 2 different ARRAYs → which are representing your TAGS.
// Example usage:
const wordsToFilter = ['apfel', 'apfel', 'bannane', 'banane', 'banan', 'banane_'];
const correctWords = ['apfel', 'banane'];
The words to filter → will represent your DATABASE (all TAG-DATA including wrong entries) as you can see.
The second ARRAY, is the ARRAY where you will put in the right spelling-words. You will GO only for those WORDS to be FILTERED out of your whole database.
You already can see the results…

ONLY THOSE WERE FOUND → WHICH ALSO ARE ALLOWED TO BE FOUND.
But this of course is just a part of the functionality you need.
Surely you do NOT want to maintain your RIGHT-WORDS-ARRAY → manually and adding each time a new correct value into this array → expand the filter-function.
Of course you will want to fill this SECURITY-ARRAY automatically with new entries.
How to do so? Well, here it will get tricky.
- You could expand your code by using → RegEx
Ok, let’s moving forward —> our new code would look something like…
function filterCorrectSpellings(words) {
const correctWords = words.filter(word => !/\s|_/.test(word));
return correctWords;
}
// Example usage:
const wordsToFilter = ['apfel', 'apfel ', 'bannane', 'banane', 'banan', 'banane_'];
const correctWords = filterCorrectSpellings(wordsToFilter);
console.log(correctWords); // Output: ['apfel', 'apfel', 'banane', 'banane']
And our results would look like ...

In this case, we used RegEx to find IRREGULARITIES inside of our VALUES.
But as you can see → the function was not able to filter out wrong spellings like…
-bannane
-banan
So, this is why you will need somekind of a combination of both function, where you fill manualy aswell as aoutomaticaly an array of correct words [SECURITY-ARRAY] which will then filter out all IRREGULARITIES and WRONG-SPELLINGS out of your database.
Of course this was just a simple example and you will have to put even more efforts to generate such an automation, which will keep your database always CLEAN from → irregular or wrong spelled (entered) VALUES in your DATABASE.