1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set the "Slug" of my post to be the "Category" name!

Discussion in 'Black Hat SEO' started by methos, Nov 27, 2016.

  1. methos

    methos Supreme Member

    Joined:
    Jul 18, 2013
    Messages:
    1,364
    Likes Received:
    149
    Location:
    Negative World
    Hi,

    Normally when i create a post in my website it appears like this in google :

    www.mywebsite.com/My-Post-Name

    example : https://gyazo.com/1e6356a9f5f10dc692e018e22b0fd89b


    But i want it to appears like this :

    www.mywebsite.com > "Category"

    Example : https://gyazo.com/bd1d0baff71d0be38d5403a79c61fe5c

    Note: Both my site and the other website are wordpress !
    2nd note: when you open my post and the other website post both of the are :www.website.com/the-name-of-the post

    But i want to appear in google like the 2nd screenshot !

    Any idea about that ?

    Thanks
     
    Last edited: Nov 27, 2016
  2. MikeyMikey13

    MikeyMikey13 Senior Member

    Joined:
    May 25, 2014
    Messages:
    1,047
    Likes Received:
    265
    It may sound stupid, but have you selected to add it under that cat?

    Also, I make my cat's into pages by adding this to functions:

    function wpa_alter_cat_links( $termlink, $term, $taxonomy ){
    if( 'category' != $taxonomy ) return $termlink;

    return str_replace( '/category', '', $termlink );
    }
    add_filter( 'term_link', 'wpa_alter_cat_links', 10, 3 );
    endif;

    After that, whenever I add a new post, it always comes under domain.com/cat/post-name
     
  3. MikeyMikey13

    MikeyMikey13 Senior Member

    Joined:
    May 25, 2014
    Messages:
    1,047
    Likes Received:
    265
    Also check your perma links!
     
  4. methos

    methos Supreme Member

    Joined:
    Jul 18, 2013
    Messages:
    1,364
    Likes Received:
    149
    Location:
    Negative World

    Thank you, But as i said i only want it to appears in google like that : domain.com > "category Name" ! What you showed it might get set up from permalinks!

    Regards
     
  5. mickyfu

    mickyfu Jr. VIP Jr. VIP

    Joined:
    Dec 14, 2011
    Messages:
    6,863
    Likes Received:
    19,718
    Location:
    Solihull Young Offenders
    Perma links custom structure /%category%/%postname%/
     
  6. methos

    methos Supreme Member

    Joined:
    Jul 18, 2013
    Messages:
    1,364
    Likes Received:
    149
    Location:
    Negative World
    Thanks but still not what i want, as i said in Note #2 , The normal weblink will be like that : domain.com/post-name ! but it's all about google ! I want it to appears in google like the 2nd screenshot !
     
  7. mickyfu

    mickyfu Jr. VIP Jr. VIP

    Joined:
    Dec 14, 2011
    Messages:
    6,863
    Likes Received:
    19,718
    Location:
    Solihull Young Offenders
    Do you mean so it has > in it instead of /
     
  8. methos

    methos Supreme Member

    Joined:
    Jul 18, 2013
    Messages:
    1,364
    Likes Received:
    149
    Location:
    Negative World
    Yes but also after > I need google to show the "category name" (not the "post name" ) !

    thanks again
     
  9. MikeyMikey13

    MikeyMikey13 Senior Member

    Joined:
    May 25, 2014
    Messages:
    1,047
    Likes Received:
    265
    When the text for the post name goes over a certain character count it usually shows the category rather then post name for my sites.