Question about url

Discussion in 'Content Management' started by luckypunjab, Jul 17, 2010.

  1. #1
    I saw on blogspot blogger that after 60 words they ends the, but actual post title is too long, my question is can we do this in wordpress, mean yourdomain.com/date/first-60-words-of-post.html
    this is an example.
    if Yes, then how????
     
    luckypunjab, Jul 17, 2010 IP
  2. AlcVitRes

    AlcVitRes Well-Known Member

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #2
    You ask about thing which looks more like keyword stuffing, forgetting about
    alt tag for pics & title for links, categories, page description and it's keywords.

    It hardly will add weight for your resource & only maybe 1-3 people from 100
    will be able to recall whole 60 symbols address from memory without Favorites.

    I would refer to more active use of social bookmarks, creating site page on FB
    and Twitter for "word of mouth", caring ~ frequent updates of unique content.
     
    AlcVitRes, Jul 18, 2010 IP
  3. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #3
    What do you mean???
    Answer is not clear?
     
    luckypunjab, Jul 18, 2010 IP
  4. ilovefireflies

    ilovefireflies Peon

    Messages:
    238
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    0
    #4
    ok let me put it this way.... no one is going to remember the whole 60 word title of the post. so what @luckypunjab was saying, is that you should use things like bookmarks and social media to get it out there. and search engines MAY look at the long title as a keyword stuffing process, and they may look down upon this. i would be very careful.
     
    ilovefireflies, Jul 18, 2010 IP
  5. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Not a very clever thing to do in my own opinion - the beginning of most articles (excluding the title) doesn't usually contain the phrases I'm looking for.

    However, it can be done easily with a Wordpress plugin - try something along the following lines:
    
    function first_words_slug($slug) {
        global $wpdb;
    	if ($slug) return $slug;
    
        // title length in words
        $title_length = 5;
    
        return sanitize_title(implode(' ',array_slice(explode(' ',$_POST['content']),0,$title_length)));
    }
    
    PHP:
    Hook that code to a *_save_pre event (add_filter() should do it) and your all set. :)
     
    Deacalion, Jul 18, 2010 IP
  6. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #6
    Where is this located??
     
    luckypunjab, Jul 19, 2010 IP
  7. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You will have to make a custom plugin. Hooks are provided by wordpress to fire sections of code on certain events. Look Here. Take a look at the *_save_pre event events.
     
    Deacalion, Jul 19, 2010 IP
  8. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #8
    Sorry friend i am not a web-developer that i can't make any plug-in.
     
    luckypunjab, Jul 19, 2010 IP
  9. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    ok. I've made a plugin for you, here:
    
    <?php
    /*
    Plugin Name: Dynamic Content Slugs
    Plugin URI: http://www.dirtymonkey.co.uk
    Description: Creates slugs from the first n number of words in the post content
    Version: 0.1
    Author: Matt. 'Deacalion' Stevens      
    */
    
    add_filter('wp_insert_post_data', 'first_words_slug');
    
    function first_words_slug($data) {
        
        // title length in words
        $title_length = 5;
        
        // build slug from post content
        $data['post_name'] = sanitize_title(implode(' ', array_slice(explode(' ',$data['post_content']),0, $title_length)));
        
        return $data;
    }
    ?>
    
    PHP:
    Save it to wp-content/plugins/first-word-slugs/contentSlugs.php, activate - then every post you make will have slugs based on the content.
     
    Deacalion, Jul 19, 2010 IP
  10. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #10
    Did you tested it on any other blog??
     
    luckypunjab, Jul 19, 2010 IP
  11. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Un-tested... don't have the time. :) Surely you can just try it?
     
    Deacalion, Jul 19, 2010 IP
  12. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #12
    Ok i will take the risk [​IMG]
     
    luckypunjab, Jul 19, 2010 IP
  13. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #13
    luckypunjab, Jul 19, 2010 IP
  14. ladylioness

    ladylioness Peon

    Messages:
    411
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Exactly--do you understand now? I think ilovefireflies has broke it down for you so you can understand
     
    ladylioness, Jul 19, 2010 IP
  15. luckypunjab

    luckypunjab Member

    Messages:
    841
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    33
    #15
    I found a plugin that cut the unnecessary words for url automatically and make the url more search friendly
     
    luckypunjab, Jul 20, 2010 IP
  16. ladylioness

    ladylioness Peon

    Messages:
    411
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Okay, great! I thought you could just change the permalinks to %postname% or something like that??
     
    ladylioness, Jul 20, 2010 IP