Designed By: @anutrickz
Version: 1.0.2-beta

Robots Txt Generater Tool using HTML JS

 

robot.txt generator script using html js


In today's digital age, it's essential to have a website that is easily searchable and indexable by search engines. However, it's equally important to ensure that certain pages or sections of your website are not crawled or indexed by search engines, especially if they contain sensitive or confidential information.

The Robots.txt Generator Tool is a web-based tool that allows you to create a robots.txt file by simply filling out a few fields. The tool generates the code for the robots.txt file automatically, saving you time and effort.

In this post, we will show you how to create a simple Robots.txt Generator Tool using HTML and JavaScript.

Step 1: Create the HTML structure

First, create an HTML file and add the necessary structure for the webpage. We will create a simple form that will take user input and generate the Robots.txt file code.

<div class="at_robottxt_container"><h1>Generate robots.txt</h1>

<label class="at_level" for="website-url">Website URL:</label>

<input class="at_input" type="text" id="website-url" placeholder="Enter Your Website URL with ‘https://’"><br>

<label for="platform-select">Platform:</label>

<select id="platform-select">

    <option value="blogger">Blogger</option>

    <option value="wordpress">WordPress</option>

</select><br>

<button id="generate-btn">Generate</button><br><br>

<div id="output-container" style="display:none">

    <p id="output-text"></p>

    <button id="copy-btn" style="display:none">Copy to clipboard</button>

  </div></div>


In this HTML code, we have created a simple form that includes the website URL, and the pages to block. We have also included a button that will trigger the JavaScript function to generate the Robots.txt code.


Step 2: Create the JavaScript file

Next, add the following  javascript code:

Download code

This JavaScript code defines a function called "generateRobotsTxt" that will be triggered when the button in the HTML form is clicked. This function will take the input values from the HTML form and generate the Robots.txt code.

In conclusion, the Robots.txt Generator Tool is an easy and efficient way to create a robots.txt file for your website. With the help of this tool, you can ensure that your website is easily searchable and indexable by search engines, while also protecting sensitive or confidential information from being crawled or indexed.

contact us: