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 ställer du in automatisk upptäckt för dina RSS-flöden i WordPress

Har du lagt märke till att när du besöker WPBeginner, i fältet URL finns en RSS Icon. Ofta ser du den här ikonen på webbplatser som har ställt in sina RSS-flöden på automatisk upptäckt. Genom att ställa in automatisk upptäckt uppmuntrar du dina användare att prenumerera, och du informerar också de som inte vet att de också ska prenumerera. De flesta teman ignorerar den här funktionen som kan vara en enda viktigaste funktionen som du bör ha i dina teman. I denna tutorial kommer vi att visa dig hur du kan ställa in automatisk upptäckt för dina WordPress RSS-flöden.

RSS Auto Discovery

Öppna din header.php och klistra in följande koder ovanför </head> -koden.

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo(‘rss2_url’); ?>" />

    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo(‘rss_url’); ?>" />

    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo(‘atom_url’); ?>" />

    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo(‘name’); ?> RSS Comments Feed" href="<?php bloginfo(‘comments_rss2_url’); ?>" />

Många trovärdiga webbplatser i branschen har tagit detta steg för att se till att deras läsare prenumererar på deras webbplatser. Du bör kontrollera om dessa koder finns i din header-fil, om ej så bör du add to den. Glöm inte om du vill spåra dina RSS-prenumeranter, då bör du omdirigera dina flöden till FeedBurner.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial 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.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

9 kommentarerLeave a Reply

  1. mohadese esmaeeli

    Hello! Is having an RSS feed field for site SEO dangerous? There are various theories on this matter, and I appreciate it if you share your professional opinion. Also, under what conditions should one use RSS?

    • WPBeginner Support

      No, having an RSS feed is not dangerous it can even help search engines crawl your content. Most sites should normally have an RSS feed.

      Admin

  2. Kyle Alm

    I just implemented this on my blog, is this one of the reasons why CommentLuv doesn’t pickup my “Recent Blog Posts?”

    • Editorial Staff

      I don’t think that CommentLuv has anything to do with this technique.

      Admin

  3. Belinda

    I don’t think you mean below the /head code… I think you mean above it? As in, still within the head tags?? Let me know if I am misunderstanding something.

      • kf

        Would you mind correcting the entry? It’s only been about 3 years now.

        I’ve blown 45 minutes trying to corroborate the above or below /head tag and just for giggles, scrolled down to read comments. No offense, but failing to correct the entry doesn’t give your site credibility. I have a technical site too but I don’t force my visitors to do any more work than they have to. The easier I make it, the more likely they are to give me money. Just sayin…

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.