This might be a bug, but I’m not sure enough if I’m missing something.
As you can see, I removed most of the default web search keywords and defined a few of my own:
One of them using the gh keyword that GitHub would normally use. However, when trying to use this in KRunner, it still sends me to GitHub:

I’ve rebooted since making these changes, so it’s not just leftover from when the process started.
While looking into this, I found this detail and was wondering if this might be the cause. But even after deleting /usr/share/kservices5/searchproviders/github.desktop from my system, KRunner still suggests GitHub when I use gh.
Where else could this be coming from?
Well, assuming you’re running Plasma 6, the right place would be /usr/share/kf6/searchproviders/, not the old Plasma 5 path.
Also, you can actually put your custom web shortcuts in ~/.local/share/kf6/searchproviders and those should be preferred over the system ones. I mention that trick in KFluff – New KRunner web shortcuts for development and user support (just with the Plasma 5 version since that’s when I wrote that).
Thanks, interestingly there’s a github.desktop file in both those places you mentioned. I don’t quite understand why there is still one even in my home directory after I explicitely deleted the Github entry from the KRunner list. I assume the the search providers are not just used by KRunner, so me deleting the entry from the KRunner settings list doesn’t impact the *.desktop files?
But if that’s the case, why does KRunner still give those preference over something I explicitely configured myself? Even when I checked the “Use preferred keywords only” setting, it would still not use my own gh keyword definition. I had to delete every github.desktop file, both from the Plasma 6 path and my home directory before it would use my own gh definition. (Not sure where I found that kf5 path, but I have never been on Plasma 5 as this is a pretty new install, so it’s also a bit confusing to me that this path even exists on my system.)
Would you say that’s a bug, or am I still missing something here?
When you edit an existing entry via the GUI, a copy of the original is put in ~/.local/share/kf6/searchproviders so that the original isn’t tampered with.
So if you edited github to not use gh and added your own entry that does use gh and your entry isn’t followed, then that is a bug, yes.
Note that if you change the entry manually, you need to restart the KRunner process for it to trigger immediately.