5 thoughts on “5 Steps to turn WordPress category pages into a landing page

  1. Thanks Michele, nice article!
    In my opinion is the best practice for archive pages NOINDEX,FOLLOW. Category archives (and sometimes tag archives too) should be indexed only if they offer additional unique content.

    About your question regarding the slugs for URLs on category archive pages. If your website is small and doesn’t have so much traffic you can remove the “category” part (like suggested). If you have (much) more 500 articles, it’s often better to keep them. Otherwise WordPress has to check an URL multiple times to get a match:


    This URL could be a child-page, a post (if you use the article slug in your post URL) or a sub-category if you’ve removed “category” from your slug.

  2. With one of my larger sites, I had accidentally diluted my main keyword for posts within a category. I went back and eliminated the keyword from the posts and worked on the category page too. Now the category page is ranking well for that term. As much as I grumbled about stupid Google, it actually makes more sense now.

    With this site, if someone was searching for a general phrase like “php tutorials” seems like they should hit your category page rather than an individual post.

    NOINDEX makes sense if you have not taken the effort to make the content on any page unique. The whole idea of this tutorial is to create category pages with unique content that also offers a bit of link bait. The description and the excerpts should take care of that. Some of my category pages read a bit like a mini article rather than a simple, “Here’s where I keep my posts on…”

    I’m a bit confused about WP having to check the URL. Doesn’t WP know what are posts, pages and category/archives based on some internal setting? Doesn’t it have to check that to know which templates to use anyway? Why does removing the category slug make that any more difficult for the program?

    • Hi Michele,

      right a category page makes sense, because there are always people interested only in single categories. About your question(s).

      ’m a bit confused about WP having to check the URL. Doesn’t WP know what are posts, pages and category/archives based on some internal setting?

      WordPress has to parse the URL first (I think the split the REQUEST_URI), for example for the post it would be:

      The keyword “archives” identifies the second part as a slug from the type post. Now WordPress has to look for a post with the post_name “wordpress-category-pages-into-landing-page” in side the wp_post table. You understand that a category slug makes it more difficult because WordPress has to check first for a parent page type article and next WP has to perform a query on the taxonomy tables. Finally WordPress is able to do a query on the posts table. Makes sense? There is not a table that maintains all the URLs like in other systems.

      The information, which template is used, is stored inside the wp_options table and WordPress has to load these options for every (non-cached) page request.

  3. Hello Michele!

    Thank you for the great information. My categories are almost finished, but I have a small problem with the Yoast plugin. How can I display the description only on the first page of each category with the Yoast plugin? I can’t find this option! I hope you can point me into the right direction!

    • Hi Sharon,

      Thank you for your question. Unfortunately, I made a mistake in the article and you found it.

      With the Yoast Plugin, you can set it up where the secondary pages of a category can be NOINDEX or NOFOLLOW but there is not a way (at least as of February 2015), to display the category description only on the first page of a category.

      That is not to say that there is not a way to do this, it just requires a bit of editing one of the templates of your theme.

      Before editing your theme, I would suggest making sure that the theme’s author has not already designed their theme to only display the category description on the first page. For the sake of simplicity, I’m going to assume that the theme is already set up to display the descriptions.

      If you currently do not have a category that spans more than one page, go to Settings > Reading and change “Blog pages show at most” to 1. This is the number of posts that will show on a category page. Visit a category that has at least 2 posts to see whether or not the category description is displayed on every page.

      If the description is showing on every page, not to worry, we can fix that. We will be working on your live site, so be sure to backup your files before you begin making changes.

      Go to Appearance > Editor. On the right side of the screen, you should see a list of templates. Click on Archives or Category. Your theme will most likely only have one or the other. If it has both, choose category.

      Look for the line that says:

      We can put some logic around that statement saying if we are on the first page of the category show the description otherwise/else don’t show the description.

      First take the line that I told you to find and replace it with these 3 lines of code…

      That will display the description only on the first page of the category.

      You could stop here and just not have anything appear on the secondary pages, but I’m not a fan of doing things that way. I often use something like the following on my secondary category pages: “You are viewing page x of y from our category-name category of posts.” (category-name being the name of the category being shown)

      Now here’s where I’m going to make Olaf and some other programmers cringe. I will sometimes use more code than I need to. It makes the computer work a little harder but makes it easier to make edits later. I use the “correct” coding techniques as much as possible but I will break the so-called rules when I think it makes sense.

      Instead of using an “if-then-else” structure, I think it is easier, at least for me, to make a separate statement that takes care of the secondary pages. That way I can more easily add other elements like category pictures or advertising.

      After adding the first 3 lines of code I have provided, you will need to add the following code to check and see if the page is a secondary page and then automatically add your message. I have included my custom text in bold so you can see how to use it in the code if you wanted to change it slightly. The   in front of from is forcing a space to appear between “of” and “from”. (For some odd reason, the code is ignoring it in the echo statement.

      If you want to change the message, carefully edit the code I have provided by replacing the bolded text with your message. It is bolded only for this tutorial. When you paste the code into your template file, the bolding will be automatically removed.

Comment Rules

Don’t post your code here, post your code block or snippet to pastebin and include the pastebin URL in your comment.

I delete all comments with non related links inside the comment text. Don't use keywords for the field of your real name (most people like to use your name for their answer). Keep your comment related to the topic, if your question is off-topic, please use the contact form instead.

Leave a Reply

Your email address will not be published. Required fields are marked *