Thoughts typically stick around as long as we react to them. Even searching online is just another reaction to the uncertainty the thought causes.
The more you react to a thought and enjoy getting rid of it, the more your brain will give you that thought so you can try to get rid of it and feel relief. As misguided as it may seem, your brain is trying to help you get what you want: relief from the intrusive thought.
Unfortunately, what’s the first thing you need if you want to get rid of a horrible intrusive thought? You need a horrible intrusive thought.