Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här hindrar du search engines från att crawla en site i WordPress

Senast frågade en av våra användare oss hur de kan hindra search engines från att crawla och indexera deras WordPress webbplatser.

Det finns flera scenarier när du vill hindra search engines från att crawla din website och lista den i sökresultaten.

I den här artikeln visar vi dig hur du hindrar search engines från att crawla en site i WordPress.

How to Stop Search Engines From Crawling a WordPress Site

Varför hindra search engines från att crawla en site i WordPress?

För de flesta WordPress websites är search engines den största trafikkällan. You kanske undrar varför någon skulle vilja motarbeta search engines?

Här är några situationer när du inte vill att search engines ska indexera din website:

  • När du börjar kanske du ej vet hur man skapar en lokal utvecklingsmiljö eller en staging site, och istället utvecklar du din website medan den är live. Du vill inte att Google ska indexera din site när den är under uppbyggnad eller i underhållsläge.
  • Det finns också många människor som använder WordPress för att skapa privata bloggar. De vill inte att de ska indexeras av search engines eftersom de är privata.
  • Du kan använda WordPress för hantering av projekt eller för ett intranät. I dessa fall vill du inte att dina interna dokument ska vara tillgängliga för allmänheten.

En vanlig missuppfattning är att om du inte har links som pekar till din domän, så kommer search engines förmodligen aldrig att hitta din website. Detta är ej helt sant.

Det kan t.ex. finnas links som pekar till din site eftersom domain name tidigare ägdes av någon annan. Det finns också tusentals pages på internet som helt enkelt listar domain names. Your site kan dyka upp på en av dessa.

Med det sagt, låt oss ta en titt på hur man hindrar search engines från att crawla din website. Vi kommer att täcka fyra metoder:

Metod 1: Be search engines att ej crawla din site i WordPress

Detta är den enklaste metoden men skyddar inte din website helt från att bli crawlad.

WordPress kommer med en utvald funktion som allowar dig att instruera search engines att inte indexera din site. Allt du behöver göra är att gå till Settings ” Läsa och kontrollera boxen bredvid ’Search Engine Visibility’.

Search Engine Visibility Setting in WordPress

När den här boxen är kontrollerad addar WordPress den här raden till din websites header:

<meta name='robots' content='noindex,follow' />

WordPress ändrar också din sites robots.txt-fil och addar en disallow-regel till den:

User-agent: *
Disallow: /

Dessa rader ber robotar (web crawlers eller bots) att ej indexera dina pages. Det är dock helt upp till search engines att godkänna denna request eller ignorera den. Även om de flesta search engines respekterar request finns det fortfarande en chans att vissa pages eller images från din site indexeras.

Om du vill göra det omöjligt för search engines att indexera eller crawla din website måste du skydda din WordPress site med password genom att använda metod 3 eller 4.

Metod 2: Be search engines att ej crawla enskilda pages

Du kanske vill att search engines ska crawla och indexera din website, eller ej inkludera ett visst post eller en specifik page i sökresultaten.

Det enklaste sättet att göra det är att använda All in One SEO (AIOSEO) plugin. Det är det bästa verktyget för sökmotorsoptimering för WordPress och används av över 3 miljoner företag.

För denna tutorial kommer vi att använda den gratis versionen av AIOSEO eftersom den innehåller verktyget för sökmotorsoptimering. Det finns också en premiumversion av AIOSEO som erbjuder fler funktioner som tools för webbplatskartor, redirection manager, schema markup, robots.txt editor och mer.

Det första du behöver göra är att installera och aktivera pluginet AIOSEO på din website. Du kan lära dig hur du installerar och konfigurerar pluginet genom att följa vår Step-by-Step guide om hur du ställer in All in One SEO för WordPress.

När pluginet är konfigurerat kan du använda det för att be search engines att ej indexera vissa posts och pages. Återigen är det helt upp till search engines att godkänna denna request eller ignorera den.

Du behöver bara editera det post eller den page som du inte vill ska indexeras. Du måste rulla ner till AIOSEO Settings längst ner i WordPress editor och sedan klicka på tabben ”Advanced”.

AIOSEO Advanced Settings

Notice that the article is using the standard robots settings.

För att ändra detta måste du toggle ”Use Default Settings” till positionen off.

Asking Search Engines Not to Index a Single Page

Nu kan du klicka på checkboxen ”No Index”. När posten har publicerats eller uppdaterats kommer search engines att bli ombedda att ej indexera den.

För att lära dig mer, se vår detaljerade AIOSEO review.

Metod 3: Skydda en hel site med password med hjälp av cPanel

Om din hosting provider för WordPress erbjuder cPanel-åtkomst för att hantera ditt hosting account, kan du skydda hela din site med hjälp av cPanel.

Allt du behöver göra är att logga in på din cPanel dashboard och sedan klicka på ”Directory Privacy” icon i ”Files” section.

Using cPanel's Directory Privacy Feature

Därefter måste du hitta den folder där du installerade WordPress. Vanligtvis är det mappen public_html.

Efter det klickar du bara på knappen ”Edit” bredvid den mappen.

Edit the Root Folder

Note: Om du har flera WordPress-webbplatser installerade under public_html directory, måste du clicka på public_html-länken för att browsa dessa webbplatser och sedan editera foldern för den website du vill skydda med password.

Då kommer du till en vy där du kan aktivera skydd med password.

Kontrollera bara boxen som säger ”Password protect this directory” och click the ”Save” button. Om du gillar det kan du också customize namnet på den skyddade katalogen.

Check the Box to Password Protect This Directory

You will see a confirmation message saying that the access permissions for the directory have been changed.

Därefter måste du clicka på knappen ”Go Back”.

cPanel's Directory Privacy Success Message

You will be taken to a vy where you can create a användarnamn and password that will be needed to be used when accessing this directory.

Du måste enter ett användarnamn och ett lösenord och sedan bekräfta lösenordet. Se till att obs/observera användarnamn och password på en säker plats, t.ex. i en app för lösenordshantering.

Add a Username and Password

När du klickar på knappen ”Save” har du utan problem lagt till ett skydd mot password på din WordPress site.

Nu, när en användare eller search engine besöker your website, kommer de att uppmanas att enter användarnamn och password som du skapade tidigare för att kunna view the website.

A Username and Password Are Now Needed to Access Your Website

Metod 4: Password-skydd av WordPress med ett tillägg

Om du använder ett hanterat webbhotell för WordPress kanske du ej har tillgång till cPanel. I så fall kan du använda ett tillägg till WordPress för att skydda din site med password.

Här är de två mest populära lösningarna:

  1. SeedProd är #1 coming soon och underhållsläges plugin för WordPress, som används på över 800 000 websites. Det levereras med kompletta funktioner för åtkomstkontroll och behörighet som du kan använda för att dölja din website från alla, inklusive search engines. Vi har en Step-by-Step guide för SeedProd.
  2. Password Protected är ett mycket enkelt sätt att lösenordsskydda din WordPress site med ett enda lösenord (ingen användare behöver skapas). Se vår Step-by-Step guide om hur du lösenordskyddar en WordPress site.

Expert Guides on Search Engine Crawling and Indexing (guider för crawl och indexering av sökmotorer)

Nu när du vet hur du hindrar search engines från att crawla din site, kanske du vill se några fler guider om sökmotor crawling och indexering i WordPress.

Vi hoppas att den här artikeln hjälpte dig att stoppa search engines från att crawla eller indexera din WordPress site. You may also want to see our guide on how to speed up your website performance or our expert picks for the best WordPress landing page plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

29 kommentarerLämna ett svar

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    I have read that often these procedures, as well as robots.txt, are only recommended behavior for a robot. How to avoid being searched for real. Is it possible, for example, to block the ranges of Google and Bing, for example, with the help of an .htaccess file?

      • Jiří Vaněk says

        I understand that, but I assume that then the website will not be public and only those who know the login and password will be able to access it? My idea was just to try to find the ip ranges of the bots and block them at the htacess file level eg. Does that make sense or is it nonsense?

        • WPBeginner Support says

          There is no guarantee that the bots would not find the site at a later date with a different IP. If you want to be certain that your site is not crawled you would want it to be a private site, otherwise the best option is to use the robots.txt to request the site not be crawled.

  3. mohadese esmaeeli says

    Is the prevalent belief correct that having a large number of indexed pages within a site has no effect on indexing the rest of the pages?

    • WPBeginner Support says

      Just because you have pages that are indexed on your site does not mean you can’t have other pages hidden from crawlers to prevent indexing.

      Administratör

  4. Moinuddin Waheed says

    I have been several times in the thinking while in the settings tab of the wordpress dashboard that why would any one would want to discourage Google to show the page or post from visibility. Today infact after reading this post , I came to know about the reasons why would anyone discourage search engine indexing.
    it is very simple to do infact. we need to check the box in settings tab reading section where it asks to discourage search engines for visibility.
    Thanks for clearing my long held doubt.

  5. Charlotte says

    This is was just what I was looking for. After I moved my dev site to the client’s live site, I didn’t want any traffic coming back to the old one. Thank you!

  6. Ryan says

    I deleted my site permanently from wordpress and when I google my name, the old wordpress site still appears, despite the fact that it’s gone. Can someone from the support team help me to delete it? I don’t want my clients getting confused with my actual, live site.

  7. Divyanshu says

    if we disable indexing the wordpress site to prevent it from hackers, then will it affect google indexing or not, and if then how to allow google to index my pages

    • WPBeginner Support says

      Hi Andy,

      If you have password protected your subdomain directory, then please review its settings again in cPanel. If everything looks alright, then you may want to contact your WordPress hosting provider.

      Administratör

    • Jay says

      Yeah, whats written under ”Discourage search engines from indexing site” is very true. Google doesnt seems to honor this

  8. chinju says

    Hi, I have a doubt that if website have 1 million subpages, search engine block all subpage when we add
    User-agent: *
    Disallow: /
    in robots file?

    • Shekhar Sardar says

      Yes. Adding Disallow:/ in robot.txt will tell all search engine bots, do not crawl this site or web page.

  9. Joojo says

    Hello,

    I’m currently having a WordPress.com Blog (Free Plan) & desire to sell my Digital Stuff online without setting-up a website and relying wholly on the Blog, at first (have been short of funds). Thus, going through with this thought I have made changes to my Blog, under this after making the payment, the customer is redirected to my blog page haivng a link to download the digital content. So, I just want the payment gateway to be able to redirect the traffic to the Download page on my blog and not have it searchable via search engines, etc. & neither be it listed under the WordPress.com Posts list/Pages, etc. because if the download page is searchable by the Search Engines & listed under my Blog’s post, I wouldn’t earn anything because then the customer would directly download the content without making the payment.

    Regards,
    Joojo.

  10. Jennifer says

    I’m learning WP now and designing my site. For now, I don’t want the site crawled, so I’ve checked the Search Engine Visibility Box and I’ve add the password protection. However, in a few months, I’ll want the site to go live and I’ll want visitors to my site. If I uncheck the Search Engine Visibility box and take off the password protection, will the robots nofollow header automatically be updated? Or will I have to manually update this in the header section?

    • WPBeginner Support says

      Yes, it will be. However, to be extra sure you need to submit your site’s xml sitemap using Google webmaster tools. This will allow you to see if any crawl errors are found on your site.

      Administratör

    • Chad says

      WordPress offers a Password Protect Option on any of your pages and posts. Simply change ”visibility” in your page or post edit to ”password protected”.

  11. Patrick says

    How can I get Google and bing to crawl my site while stopping SeMalt from crawling my site. SeMalt sends traffic to my site making it look like I have more hits, however thesclicks leave my site straight away and by so doing so increase the bounce rate to my wordpress site.
    Any help on this matter would be great.
    Patrick

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.