how to add line in robot.txt

#982109
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    We apologize for the issue you are facing. To update your robots.txt file using Rank Math, you can follow these steps:

    1. Access the Robots.txt Editor: Go to the Rank Math dashboard in your WordPress admin area and navigate to the General Settings section, then select Edit Robots.txt.

    2. Add/Edit Code: In the available text area, you can add or edit the rules as you prefer. For example, you can add directives like User-agent, Disallow, and Allow to control how search engines crawl your site.

      Add code to robots.txt

    3. Save Your Changes: After making the necessary changes, click on the Save Changes button at the bottom of the page.

      Save Changes

    Caution: Please be careful while making any changes to your robots.txt file, as incorrect settings can negatively impact your site’s visibility in search engines.

    For more detailed information on the rules you can use in your robots.txt file, you can refer to our knowledgebase article.

    If you have any specific issues or need further assistance, please reply to this ticket, and a human agent from our support team will assist you further.

    Sources:
    How to Edit Your Robots.txt With Rank Math SEO » Rank Math
    How to Add Sitemaps to Robots.txt » Rank Math

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    Si j’ajoute juste la ligne, est-ce que la configuration de base par defaut va être remplacer par juste cette ligne ?

    Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js
    ou elle va être rajoute en plus ?

    Exemple 1:
    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js
    Sitemap: https://dev-web-agency.com/sitemap_index.xml

    ou Exemple 2:
    Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js

    Merci d’avance,
    Cordialement

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    Currently I have added the disallow line “Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js”

    This gives this:

    User agent: *
    Disallow: /wp-admin/
    Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js
    Allow: /wp-admin/admin-ajax.php
    Sitemap: https://dev-web-agency.com/sitemap_index.xml

    Is this correct according to you?

    Thank you,
    Sincerely

    Hello,

    Thank you for your patience.

    Yes, once you start typing in the robots.txt, the default lines will be removed, so you need to type again our recommended rules.

    The last format you shared is the correct one you should use:

    User agent: *
    Disallow: /wp-admin/
    Disallow: /wp-content/plugins/link-juice-optimizer/public/js/link-juice-optimizer.js
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://dev-web-agency.com/sitemap_index.xml
    

    Looking forward to helping you.

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    D’accord merci, pour ce qui est de la search console, savez-vous pourquoi j’ai “0” dans les pages découverte ?
    Voici l’url de l’image : https://imgur.com/a/wJr7gZB

    Merci d’avance,
    Cordialement

    Hello,

    Please note that the ‘Discovered Pages’ tab only shows the number of pages that were discovered using the sitemap, and since the sitemap is not the only tool Google uses to discover pages, the number of ‘Discovered Pages’ might differ from the number of pages on your sitemap.

    In this case, it seems Google discovered all the pages without the sitemap. In fact, it could be a good sign, as it means that you have good internal linking and that Google does not need a sitemap to find some of your pages.

    Don’t hesitate to let us know if you need our assistance with anything else.

    Moussa El hadj mimoune
    Rank Math free
    Content AI Starter

    D’accord je vous remercie

    Hello,

    We are glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘how to add line in robot.txt’ is closed to new replies.