1
0
Fork 0
isopod.cool/blog/posts/guide_blacklist_websites_searxng/index.html
2023-09-02 06:01:53 -06:00

38 lines
2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Guide - Blacklisting Websites in SearXNG</title>
<link href="../../../style.css" rel="stylesheet" type="text/css" media="all">
<style>
h1 {
background-image: url('searxng.svg');
}
</style>
</head>
<body>
<h1>guide:</h1>
<h2 id="caption">Blacklisting Websites in SearXNG</h2>
<nav>
<a href="../../../">home</a>
<a href="../../">blog</a>
</nav>
<p>Quick one today. I got sick of searching for programming questions and seeing AI-generated scraped-from-stackoverflow click farm trash polluting the results, and I happen to use a personal SearXNG instance that no client-side blacklist extension on the planet is gonna support, so I went looking to see if I could blacklist them in SearXNG for like the eighth time and finally found a way using the hostname replace plugin. So here's that, because I didn't find this feature documented officially anywhere bar an <a href="https://github.com/searxng/searxng/discussions/970" target="_blank">issue</a> on the Github repo.</p>
<h2>How to do it</h2>
<p>First, open up your instance's config file. If you installed it directly like I did, that'll probably be <code>/etc/searxng/settings.yml</code>. If you used Docker, god help you. Anyway, find the <code>enabled_plugins:</code> section and uncomment the entry for <code>'Hostname replace'</code>, then uncomment the line <code>hostname_replace:</code> just below it. Under there you'll put your blocks:</p>
<code>
<span class="codetitle">/etc/searxng/settings.yml</span>
enabled_plugins:<br>
&nbsp;&nbsp;- 'Hostname replace'<br><br>
hostname_replace:<br>
&nbsp;&nbsp;'(.*\.)?codegrepper\.com': false<br>
&nbsp;&nbsp;'(.*\.)?geeksforgeeks\.org': false
</code>
<p>Then restart SearXNG:</p>
<code>
$ service uwsgi restart searxng
</code>
</body>
</html>