Description
Hi there! Because most third-party services aren't free, and the Wikidot search function hasn't worked since the 2020 hacking event, I found a better search method. It uses Bing search (which usually shows more obscure websites than Google search).
This should work on any open or closed site, but will not work on private sites because it needs the pages to be crawled by Bing. To help Bing crawl and catalog all your pages, you could use a free Microsoft account to make a free Bing Webmaster account. Also, if you use the Bing webmaster tools, then you submit your site map using this the URL "http://MY-WEBSITE-NAME.wikidot.com/sitemap.xml", where you put in your wiki's name.
Code
Below is the code/text for this method; all you need to do is copy and paste this into your website and change two things. In the preamble and in the actual code, where it says "MY-WEBSITE-NAME", you should replace this with your wiki's URL prefix. For example, if your site is bob-dry-cleaning-service.wikidot.com, then you should replace the text "MY-WEBSITE-NAME" with the text "bob-dry-cleaning-service". Don't paste the full URL in because this will mess things up.
Below is the searching mechanism to browse the site, because the Wikidot-native search is currently non-functional. The HTML code for this function was mostly generated by the Microsoft Copilot AI. The code can be found at https://snippets.wikidot.com/code:working-search-for-open-and-closed-wikidot-sites.
Instructions:
# **Enter your query in the field below.** This should consist of key words or phrases you want to find. Don't use any of the [[[*https://www.wikidot.com/doc:searching|Wikidot search syntax]]]. Bing search syntax might not work properly. If the search field doesn't appear, try reloading the page.
# **Click the "Search" button.** This will only bring up pages from this wiki that have been crawled by Bing. The search works by filtering the results so that only pages on this wiki are shown (this is accomplished by the text reading "site:MY-WEBSITE-NAME.wikidot.com"). This means that editing the query in the bottom box may mess up the search if you delete the filter (this means that you will be searching the entire web). To avoid this, just use the first search box with the box around it, only modifying the query in the second box if you want to use Bing search syntax.
# **View the search results in the below box.** If you have not searched anything, the box will appear empty. This is normal.
[[html]]
<!DOCTYPE html>
<html>
<head>
<title>Search My Site</title>
<style>
.search-box {
border: 1px solid black;
padding: 10px;
width: 90%; /* Adjust the width as needed */
height: fit-content;
}
.search-input {
width: 75vw; /* Make the input field take the full width */
padding: 10px; /* Add some padding for better appearance */
font-size: 16px; /* Increase the font size */
}
.search-button {
padding: 10px 20px; /* Add padding to the button */
font-size: 16px; /* Increase the font size */
}
.results-box {
border: 1px solid black;
padding: 10px;
width: 90%;
height: 500px; /* Adjust the height as needed */
margin-top: 20px;
}
</style>
<script type="text/javascript">
function searchSite() {
var query = document.getElementById('searchQuery').value;
var resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '<iframe src="https://www.bing.com/search?q=site:MY-WEBSITE-NAME.wikidot.com ' + query + '" width="100%" height="100%"></iframe>';
return false;
}
</script>
</head>
<body>
<form onsubmit="return searchSite();">
<div class="search-box">
<input type="text" id="searchQuery" name="q" class="search-input" placeholder="Search the wiki . . ." />
<input type="submit" value="Search" class="search-button" />
</div>
</form>
<div id="results" class="results-box"></div>
</body>
</html>
[[/html]]
If you know people who might find this information valuable, spread the word!
In action
Below is an example of how this would work. I also included the preamble in the example.
Below is the searching mechanism to browse the site, because the Wikidot-native search is currently non-functional. The HTML code for this function was mostly generated by the Microsoft Copilot AI. The code can be found at https://snippets.wikidot.com/code:working-search-for-open-and-closed-wikidot-sites.
Instructions:
- Enter your query in the field below. This should consist of key words or phrases you want to find. Don't use any of the Wikidot search syntax. Bing search syntax might not work properly. If the search field doesn't appear, try reloading the page.
- Click the "Search" button. This will only bring up pages from this wiki that have been crawled by Bing. The search works by filtering the results so that only pages on this wiki are shown (this is accomplished by the text reading "site:snippets.wikidot.com"). This means that editing the query in the bottom box may mess up the search if you delete the filter (this means that you will be searching the entire web). To avoid this, just use the first search box with the box around it, only modifying the query in the second box if you want to use Bing search syntax.
- View the search results in the below box. If you have not searched anything, the box will appear empty. This is normal.
[フレーム]
Thanks to tsangk for this great snippet: conditional-blocks
text above inserted with:
[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]
Other snippets posted by Eye14
Rate this solution
If you think this solution is useful — rate it up!
Microsoft Bing said that I needed to download an XML file from Bing Webmaster Tools and then upload it to the root directory of my wiki, to verify my site.
I edited the code so that it only show results of your wiki. I prove it, for me it did work (though, didn't show me all the reults of my wiki, but well, that is because my wiki is not very indexed and is something that already happened with the original code).
[[html]] <html> <head> <title>SearchMySite</title> <style> .search-box{border:1pxsolidblack; padding:10px; width:90%; /*Adjustthewidthasneeded*/ height: fit-content; }.search-input{width:75vw; /*Maketheinputfieldtakethefullwidth*/ padding:10px; /*Addsomepaddingforbetterappearance*/ font-size:16px; /*Increasethefontsize*/ }.search-button{padding:10px20px; /*Addpaddingtothebutton*/ font-size:16px; /*Increasethefontsize*/ }.results-box{padding:10px; height:500px; /*Adjusttheheightasneeded*/ margin-top:20px; } </style> <scripttype="text/javascript"> functionsearchSite() {varquery = document.getElementById('searchQuery').value; varresultsDiv = document.getElementById('results'); resultsDiv.innerHTML = '<iframesrc="https://www.bing.com/search?q=site:alternate-sandbox.wikidot.com ' + query + '" width="100%" height="100%"></iframe>'; returnfalse; } </script> </head> <body> <formonsubmit="returnsearchSite();"> <divclass="search-box"> <inputtype="text" id="searchQuery" name="q" class="search-input" placeholder="SearchingtheWiki . . ." /><inputtype="submit" value="🔍" class="search-button" /><divid="results" class="results-box"></div> </div> </form> </body> </html> [[/html]]
Nobody, No one, a shadow and a bad writer.
https://unwritten-mythos.wikidot.com — wether you want to visit or not is up to you, I want to see if this gets indexed more well.
I'm afraid that all it did for me was show the code. Maybe I made a typo or something. But here's the code I used:
<html>
<head>
<title>Search My Site</title>
<style>
.search-box {
border: 1px solid black;
padding: 10px;
width: 90%; /* Adjust the width as needed */
height: fit-content;
}
.search-input {
width: 75vw; /* Make the input field take the full width */
padding: 10px; /* Add some padding for better appearance */
font-size: 16px; /* Increase the font size */
}
.search-button {
padding: 10px 20px; /* Add padding to the button */
font-size: 16px; /* Increase the font size */
}
.results-box {
border: 1px solid black;
padding: 10px;
width: 90%;
height: 500px; /* Adjust the height as needed */
margin-top: 20px;
}
</style>
<script type="text/javascript">
function searchSite() {
var query = document.getElementById('searchQuery').value;
var resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '<iframe src="https://www.bing.com/search?q=site:s-a-p.wikidot.com ' + query + '" width="100%" height="100%"></iframe>';
return false;
}
</script>
</head>
<body>
<form onsubmit="return searchSite();">
<div class="search-box">
<input type="text" id="searchQuery" name="q" class="search-input" placeholder="Search the wiki . . ." />
<input type="submit" value="Search" class="search-button" />
</div>
</form>
<div id="results" class="results-box"></div>
</body>
</html>
Help | Terms of Service
5
"But as for me and my house, we shall serve the Lord."
Screenshot_20240926-014047_Chrome.jpg
I put the code on my Sandbox site and it did showed results of the wiki.
There is also this thing: When you search for an article in the search engine, it will not take you to the link, you must either copy it or open the article in another tab since it will not work if you just tap on it.
Nobody, No one, a shadow and a bad writer.
https://unwritten-mythos.wikidot.com — wether you want to visit or not is up to you, I want to see if this gets indexed more well.
Did you put the Wikidot code in the module for HTML? The Wikidot syntax for this is shown below
[[html]]
code here
[[/html]]
Okay, I did that. It works but once again, everytime I press on the weh link(s) provided in the search results box, I'm met with a
"Continue on
- Browser
- Open in Bing app
"
5
"But as for me and my house, we shall serve the Lord."
Which, again, both end in a "wiki refused to connect" message.
5
"But as for me and my house, we shall serve the Lord."
The Search engine works surprisingly well, except It seems that clicking on the actual link does not send you to said page, instead, it gives you a choice to either go to the Bing search app or open in browser and neither seem to work. I am unaware of this is because of a folly on my part, or it could be my device, but I am unable to properly use this thing.
5
"But as for me and my house, we shall serve the Lord."
I realized now that I was using Edge as a browser when I figured this out, so then I tried the search in Google Chrome and got the same result you described. I don't know if there is a way around this; if someone else with more knowledge sees this, please let us know any workarounds.
I also put this information here: http://community.wikidot.com/forum/t-16875483/what-time-allow-the-search#post-6599164.