Support » Fixing WordPress » get_the_category or type out category for article title?

  • Hi. My page handles specific media in a very limited set of categories. Every post will have a visible category assigned to it. The categories also serve as search keywords for my site.

    Example of posts:

    Video: Some artist – Title
    Music: Some artist – Title


    My question is, in WordPress, would it be better to have the title as such:

    <h2><?php get_the_category(); ?>: <?php the_title(); ?></h2>

    or as such?

    <h2><?php the_title(); ?></h2> (with the category typed out in front of the title, for example Video: title)

    My concern is that if I include the category before the title with the function, the category won’t get included in the title part of the permalink and I may lose search engine rankings because of that, especially considering these categories are usually the keywords to my site. However, my current permalink structure looks like this %category%/%postname%. If the category still gets mentioned within the permalink, just in the %category% section, would it be as good or would it be inferior to having it mentioned in the %postname% keyword wise? I’m thinking it’s possible bots don’t even separate the permalink like that and see it as a whole, but I could be wrong. Can someone please clarify this?

    Also from what I’m getting, as long as the category function is within the title (H2) tags, it won’t be any different from typing it out, because the search engine bot won’t be able to see the actual code, just the output html, which will look exactly the same? Once again, I may be wrong here so I need some insight to this.

    Currently it seems to me that it would be wiser to use the function over typing out the category, however I need your opinions to be safe on this issue.

    I would be thankful if someone could answer my questions.

Viewing 1 replies (of 1 total)
  • I think always is good, if website have simply structure – if article(title) is inside category, that is good if link is category/title.
    Good for users, good for website structure and good for search engines

Viewing 1 replies (of 1 total)
  • The topic ‘get_the_category or type out category for article title?’ is closed to new replies.