Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Frankie Jarrett 5:36 pm on April 15, 2012 Permalink | Reply
    Tags: css, , , jquery, loop, ,   

    Add first and last classes to your loop without using JavaScript 

    So you’re a pixel-perfect designer who wants to keep control over your WordPress loop styles? Hell yeah! You’re already pretty cool in my book.

    You’ve probably got a fancy post separator, or a brilliant doodle to fit between your last post and the comments. Whatever the reason, you don’t have CSS class selectors for targeting the first or last posts in your archive – and you really need them.

    There are a lot of tutorials on how to achieve this with jQuery. But it’s not worth relying on JavaScript for something that can easily be done with a little PHP magic.

    First, insert this function into your functions.php file.

    Now, open up loop.php and replace post_class() with the newly created fjarrett_post_class().

    This new function accepts the same parameters as the original function, so you can use it the exact same way. The only difference will be that the first and last posts will be marked automatically with an appropriate class name. Enjoy total control. :)

    If this helped you in any way I’d love to hear about it in the comments!

     
    • joel 9:31 pm on September 11, 2012 Permalink | Reply

      thanks! this works perfect!!

    • Luis 6:08 pm on November 9, 2012 Permalink | Reply

      Great job I searched far and wide and found nothing, till I found this worked just as is thank you.

    • Nick Meagher 6:58 pm on February 26, 2013 Permalink | Reply

      Worked great! Thanks!

  • Frankie Jarrett 5:23 pm on April 6, 2012 Permalink | Reply
    Tags: , , ,   

    The simplest way to require/include wp-load.php 

    If you want to use WordPress functionality in a PHP file that exists outside of your WordPress installation then you need to include wp-load.php. Perhaps you could call this “hooking into WordPress”.

    Maybe you’re already using some sort of relative path method, like:

    <?php include '../../../wp-load.php'; ?>

    But this can create problems if directories change. You need a clean, dynamic way to get wp-load.php. So here is the simplest way to do it, with just two lines of code (place it at the very top of your file):

    1
    2
    3
    4
    5
    6
    
    <?php
     
    $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
    require_once( $parse_uri[0] . 'wp-load.php' );
     
    ?>

    Short and sweet :)

    Disclaimer: This is intended for experimental and development purposes only. It is not advised to redundantly load WordPress on live production environments. But, why?

     
    • Christial Gold 3:12 pm on July 18, 2012 Permalink | Reply

      This makes the assumtion that the WP Content folder is named wp-content. While this is true for the default install it could be named anything. This can be defined in wp_config.php itself. For my web site it is e.g. mycontent.

      • Frankie Jarrett 3:43 pm on July 18, 2012 Permalink | Reply

        Yes, that’s correct. Thanks for the feedback!

      • Grant Landram 6:08 pm on December 10, 2012 Permalink | Reply

        Having the same issue (mine is called “content”). Any fix for irregular wp-content naming or locations?

    • ikkeaviy 2:19 am on October 29, 2012 Permalink | Reply

      where will i put the code?in what file?

      • Frankie Jarrett 12:47 pm on October 29, 2012 Permalink | Reply

        Whichever file you want to load that is outside of the WordPress templates. It must be a PHP file.

    • sy 9:51 am on November 2, 2012 Permalink | Reply

      Well, that save me some time. I was trying to make wordpress functions work on an ajaxed page. Is there some kind of shortcoming/pitfall for this method as opposed to writing an ajax function in the function.php file other than what Christian Gold mentioned?

    • sy 9:53 am on November 2, 2012 Permalink | Reply

      Nevermind I read that disclaimer.

    • peyman 6:26 am on February 14, 2013 Permalink | Reply

      Thank you very much
      I am looking for this for a long time!!!!

    • Nikita 9:56 am on February 20, 2013 Permalink | Reply

      I made some simple function which can also detect path if there’s no wp-content folder.
      function wp_path() {
      if (strstr($_SERVER["SCRIPT_FILENAME"], "/wp-content/")) {
      return preg_replace("/\/wp-content\/.*/", "", $_SERVER["SCRIPT_FILENAME"]);
      }
      return preg_replace("/\/[^\/]+?\/themes\/.*/", "", $_SERVER["SCRIPT_FILENAME"]);
      }

      Usage:
      require wp_path() . "/wp-load.php";

    • MED 11:06 pm on March 17, 2013 Permalink | Reply

      Thank you very match ;)

    • Lori 5:13 pm on March 25, 2013 Permalink | Reply

      You saved my sanity when my slider-builder wasn’t loading!
      Thank you – excellent advice!

    • Daniel Lemes 11:49 pm on June 10, 2013 Permalink | Reply

      Thank you, really “short and sweet”.

  • Frankie Jarrett 1:02 am on October 28, 2011 Permalink | Reply
    Tags: ,   

    Joining X-Team 

    Not long ago I was contacted by Dave Rosen, the CEO of X-Team, who had stumbled across my blog (this one). He was looking for a WordPress guru who could help wrangle up their many projects on the technical/development side of things.

    After just three days of communicating back and forth (and one Skype call) he offered me a full-time position, and I wholeheartedly accepted! He flew me to Los Angeles a few days later to sync up with his top developers, Weston and Josh, who have been temporarily living here while working at FOX Broadcasting.

    Needless to say, it’s been an outstanding experience working with these two. They’re not only top notch programmers but also great guys who are a blast to hang out with and have become good friends of mine. Since I’ve been here I’ve really enjoyed soaking up all the new information and techniques X-Team uses, specifically learning to incorporate version control with Git via command line into my workflow. I’m very happy to say I’m no longer Cowboy Coding! :)

    My next big task (apart from client projects) is to bring a WordPress framework into fruition for X-Team that we’re calling: WPized. Weston Ruter has laid a ton of groundwork for the WPized framework already, so I’ll be taking a lot of what he’s started and simplifying it into a tool for creating themes rapidly. I’ll also be writing a lot of documentation for our other WP developers so they will know how to use the custom helper functions the framework will offer and all of this will hopefully make the process of theming much more unified within X-Team.

    It’s an extreme privilege to be doing what I love for a company that boasts some very big clients, has a long history of doing extraordinary things and has a lot of fun doing it! I am very fortunate to not only be running my own theme shop but now also working with a superb international team on WordPress projects full-time…from home!

     
    • Stan 1:15 am on October 28, 2011 Permalink | Reply

      Way to go Frankie! Our WP team is pushed into next level with you on board. Happy to have you in team.

    • Joe 1:27 am on October 28, 2011 Permalink | Reply

      Welcome onboard Frankie!

    • Luís Fonseca 4:13 am on October 28, 2011 Permalink | Reply

      Welcome to the greatest team of all Frankie! ;)

    • Seth Hoffman 6:33 am on October 28, 2011 Permalink | Reply

      Congratulations Frankie! Really glad to hear it!

    • Dave Rosen 7:48 am on October 28, 2011 Permalink | Reply

      It’s AMAZING having you on board Frankie!

    • John 5:25 pm on November 2, 2011 Permalink | Reply

      Congrats, Frankie! What a cool project to be working on. Good luck!

  • Frankie Jarrett 3:05 pm on September 2, 2011 Permalink | Reply
    Tags: , custom taxonomies,   

    Create a dropdown of custom taxonomies in WordPress (the easy way) 

    So you’ve been busy taking advantage of custom post type functionalities in WordPress since mid 2010. And of course you’re using custom taxonomies too, right? Of course you are.

    If you’re a theme or plugin developer you may have ran across the need to populate a dropdown list of your custom taxonomies. Essentially there are two different (easy) ways to accomplish this. One you always hear about and the other you don’t.

    Method #1

    Since WP 2.1 the wp_dropdown_categories function has been around but in WP 3.0 the taxonomy argument was introduced. So just calling this function and using the taxonomy argument is probably the absolute easiest way to populate a dropdown list of your custom taxonomies.

    <?php wp_dropdown_categories( 'taxonomy=my_custom_taxonomy' ); ?>

    This method is great if you need the output of your dropdown values to be the category ID. Because this is the HTML that will be generated:

    1
    2
    3
    4
    5
    6
    
    <select name="cat" class="postform">
    	<option value="3">Tax A</option>
    	<option value="14">Tax B</option>
    	<option value="26">Tax C</option>
    	<option value="29">Tax D</option>
    </select>

    However, let’s say you want your option value output to be the taxonomy’s slug instead of the ID. Well, that’s impossible to achieve using the wp_dropdown_categories function.

    Peering into the WordPress core we see that this function is using a walker class called Walker_CategoryDropdown. This walker is designed to output only the ID as the value for each dropdown item. There is not an argument in the function to control value output.

    Method #2

    That’s where Method #2 comes in. We’ll have to write our own custom function that will generate the dropdown so we can output each option value as a slug:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    function fjarrett_custom_taxonomy_dropdown( $taxonomy ) {
    	$terms = get_terms( $taxonomy );
    	if ( $terms ) {
    		printf( '<select name="%s" class="postform">', esc_attr( $taxonomy ) );
    		foreach ( $terms as $term ) {
    			printf( '<option value="%s">%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );
    		}
    		print( '</select>' );
    	}
    }

    So, now that we’ve got a cool custom function, we can call anywhere in our code like so:

    <?php fjarrett_custom_taxonomy_dropdown( 'my_custom_taxonomy' ); ?>

    Expansions on Method #2

    If you’re a coding rockstar you can take Method #2 even further by making room for more parameters. This will give you even more control and make it function more like wp_dropdown_categories does:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    function fjarrett_custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC', $limit = '-1', $name, $show_option_all = null, $show_option_none = null ) {
    	$args = array(
    		'orderby' => $orderby,
    		'order' => $order,
    		'number' => $limit,
    	);
    	$terms = get_terms( $taxonomy, $args );
    	$name = ( $name ) ? $name : $taxonomy;
    	if ( $terms ) {
    		printf( '<select name="%s" class="postform">', esc_attr( $name ) );
    		if ( $show_option_all ) {
    			printf( '<option value="0">%s</option>', esc_html( $show_option_all ) );
    		}
    		if ( $show_option_none ) {
    			printf( '<option value="-1">%s</option>', esc_html( $show_option_none ) );
    		}
    		foreach ( $terms as $term ) {
    			printf( '<option value="%s">%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );
    		}
    		print( '</select>' );
    	}
    }

    Then call it in your code like so:

    <?php fjarrett_custom_taxonomy_dropdown( 'my_custom_taxonomy', 'date', 'DESC', '5', 'my_custom_taxonomy', 'Select All', 'Select None' ); ?>

    Conclusion

    As you can see, WordPress has done a fabulous job of making room for you and I to do pretty much whatever we want.

    To reference all available arguments and parameters, please see:
    http://codex.wordpress.org/Function_Reference/wp_dropdown_categories
    http://codex.wordpress.org/Function_Reference/get_terms

    Was this code helpful to you? Let me know in the comments!

     
    • Tim 10:11 pm on September 29, 2011 Permalink | Reply

      This works great for listing custom taxonomies but I’m having trouble getting it to submit once a selection is made.

      Any help would be greatly appreciated.

      Thanks!

    • Frankie 10:22 am on November 7, 2011 Permalink | Reply

      Tim, sounds like this could be an issue with the form you’re using to wrap this dropdown element. Send me a link and I’ll check it out.

      //Frankie

      • Tim 11:02 am on November 8, 2011 Permalink | Reply

        Hi Frankie.

        Thanks for the tutorial.

        I think I’m having the same problem as the other Tim – the dropdown is populated OK but it doesn’t submit when an item is selected.

        This is the code that I’m trying to use – a combination of your tutorial and the wp_dropdown_categories() tutorial I found in the Codex:

        <form action="/" method="get">
        

        Can you point me in the right direction?

        Thanks,

        Tim

        • Frankie 3:45 pm on November 8, 2011 Permalink

          Hi, Tim. I’d be happy to help. Ok, it depends on what function you want to perform.

          Are you using it to do a search on the front-end?

          Or are you using it in the WP Admin?

          //Frankie

        • noe ruiz 3:51 pm on September 24, 2012 Permalink

          Hey Frankie, I’m having the same issue. I’m trying to perform a simple query on a custom front page using the dropdown without a submit button. Thanks,

          Noe

      • siudek 7:37 pm on December 10, 2012 Permalink | Reply

        And? Any good ideas? I’m also doing something wrong with this – previously I had used different solutions, but this seems to be clear and simple – and I like this kind of solution very much. ;]

        BTW – many thanks for sharing the experience on the net. It sure helps in many many projects and saves tons of time. Thank you again for your time.

        /siudek

    • Caleb M 11:26 am on January 20, 2012 Permalink | Reply

      Wow, this post was very helpful! I can’t believe how long it took me to figure out a dropdown for custom taxonomies…

      Someone was asking about how to get the form to submit, so you may want to complete this tutorial by adding the complete function that wordpress devs should add to their functions.php

      For me this was:

      function custom_taxonomy_dropdown($taxonomy, $name, $show_option_all) { ?>
      	<form action="" method="get">
      	 $orderby,
      		'order' => $order,
      		'number' => $limit
      	);
      	$terms = get_terms($taxonomy, $args);
      	echo '';
      	if($show_option_all) echo ''.$show_option_all.'';
      	if($show_option_none) echo ''.$show_option_none.'';
      	foreach ($terms as $term) {
      		echo 'slug.'">'.$term->name.'';
      	}
      	echo ''; 
      	?>
      <?php }
      
      • noe ruiz 3:53 pm on September 24, 2012 Permalink | Reply

        Hi Caleb,

        I tried adjusting this to my functions page, is there a chance the formatting is off? I get errors when using this function. It’s also strange because the form tag isn’t closing.

    • Nathan 3:20 pm on February 3, 2012 Permalink | Reply

      Apparently you’re the only person who cares to post a simple, useful tutorial. THANK YOU! I’ve been testing different tutorials until my eyes were red. Your code did the trick without any complications!

      • Frankie 5:21 pm on February 3, 2012 Permalink | Reply

        Great to hear! Thanks, Nathan.

    • Michael Weaver 4:04 pm on February 14, 2012 Permalink | Reply

      This is working excellently. I am trying to add a ‘All’ option to the select, to filter to all taxonomies.

      function custom_taxonomy_dropdown($taxonomy) {
      	$terms = get_terms($taxonomy);
      	echo '';
      		echo 'All';
      	foreach ($terms as $term) {
      		echo 'slug.'">'.$term->name.'';
      	}
      	echo '';
      }
      

      I’m guessing value="0" isn’t correct. Any ideas?

      • Frankie 4:14 pm on February 14, 2012 Permalink | Reply

        Hey Michael, thanks for your comment.

        The wp_dropdown_categories() function outputs value="0" for the show_option_all argument, so this should work.

        Have you tried the Expansions on Method #2 example above?

        //Frankie

    • Michael Weaver 7:39 am on February 15, 2012 Permalink | Reply

      Thanks bud,

      just had a look at the second method, and it seemed to work perfectly until I tried the select all option, which in effect does work, it shows all ‘posts’. Im using this script for a custom post type archive page, attempting to show a dropdown menu of the custom taxonomies.

      Here is the code thats in my archive page…

      and here is the function…

      function custom_taxonomy_dropdown($taxonomy, $orderby, $order, $limit, $name, $show_option_all) {
      	$args = array(
      		'orderby' => $orderby,
      		'order' => $order,
      		'number' => $limit
      	);
      	$terms = get_terms($taxonomy, $args);
      	echo '';
      	if($show_option_all) echo ''.$show_option_all.'';
      	if($show_option_none) echo ''.$show_option_none.'';
      	foreach ($terms as $term) {
      		echo 'slug.'">'.$term->name.'';
      	}
      	echo '';
      }
      

      The value="0" shows all the posts, but none of the custom post pages, all of the others work perfectly. Any ideas?

      On a side note, someone asked about it submitting the form without a button, just add onchange="this.form.submit();" to the select element, works perfectly :D

      • Nathan 9:00 am on April 22, 2013 Permalink | Reply

        Using some of the comments on this page, and some of Frankie’s original tutorial, I’ve put together what I think most people are interested in, a tutorial on how to implement this as a dropdown without a submit button. It doesn’t seem like code posts into the comments very easily / well here so I’ll just link to it and Frankie can add the code to my comment if he’d prefer.

        http://clicknathan.com/web-design/wp_dropdown_categories-for-custom-taxonomies/

        • Frankie Jarrett 9:41 am on April 22, 2013 Permalink

          Thanks, Nathan! /five

        • Frankie Jarrett 4:41 pm on May 8, 2013 Permalink

          Hey Nate, I’ve updated my code above to properly escape the variables being outputted in the HTML. I suggest you update the code on your blog as well. Thanks again!

    • Dimitri 9:23 am on March 8, 2012 Permalink | Reply

      Hi Frankie,

      is there a way to display more than one select box, each one for a different taxonomy in order to filter posts by multiple criteria..

      Thank you

      Dimitri

      • Marek 10:06 am on August 25, 2012 Permalink | Reply

        This is exactly the same problem that is bothering me for a long time. Any solutions? pls

    • Kahil 11:35 am on May 18, 2012 Permalink | Reply

      How can this be applied to pages? In the codex there is an example of how to get a dropdown for categories and have it go to the selection without having a submit button. But I can’t get the same method to work for the page dropdown code provided in the codex. Any ideas?

      • Frankie Jarrett 11:50 am on May 18, 2012 Permalink | Reply

        Hi Kahil, Perhaps I will take a look at that issue and write a separate blog post. This post was intended for working with custom taxonomies only.

        • Kahil 12:07 pm on May 18, 2012 Permalink

          Thank you… been trying to figure that out for days now without any success. Please feel free to email me a possible solution if you’d like.

          Thanks

        • Frankie Jarrett 12:09 pm on May 18, 2012 Permalink

          If/when I post a solution it will be for everyone to see.

    • Bryan Young 8:05 pm on July 13, 2012 Permalink | Reply

      There is a simpler way to do this without rewriting the entire wp_dropdown_categories() function.

      wp_dropdown_categories() accepts an argument called ‘walker’ which can be a custom instance of the Walker_CategoryDropdown class.

      So to make your dropdown output slugs as values instead of ids you could do something like this:

      In your theme’s functions.php:

      class Walker_SlugValueCategoryDropdown extends Walker_CategoryDropdown {
      
              function start_el( &$output, $category, $depth, $args, $id = 0 ) {
                      $pad = str_repeat(' ', $depth * 3);
      
                      $cat_name = apply_filters('list_cats', $category->name, $category);
      
                      /** Only the following line is changed from the original class **/
                      $output .= "\tslug."\"";
      
                      if ( $category->term_id == $args['selected'] )
                              $output .= ' selected="selected"';
                      $output .= '>';
                      $output .= $pad.$cat_name;
                      if ( $args['show_count'] )
                              $output .= '  ('. $category->count .')';
                      $output .= "\n";
              }
      }
      
      And in your template file:
      
      $dropdown_args = array(
              'taxonomy' => 'your-custom-taxonomy',
              'walker'      => new Walker_SlugValueCategoryDropdown);
      
      wp_dropdown_categories( $dropdown_args );
      
    • Bryan Young 8:09 pm on July 13, 2012 Permalink | Reply

      For some reason, the critical line of code didn’t come through – try:

      $output .= sprintf('slug);

      • shelly 1:06 pm on December 18, 2012 Permalink | Reply

        Hey Bryan – I was trying to use your solution here, but there seems to be some syntax errors, and I’m not sure where you’re putting the last $output .= sprintf(‘slug); bit. The solution Frankie has up works great, except like Michael I need to select all option enabled and am using this on custom post types, not blog posts.

        I think your solution will work, if I can get it to … work? :-)

    • Hernandez 8:00 am on July 24, 2012 Permalink | Reply

      Hi everybody, really nice post i was try to find something like that. ;-) Thanks

      I have this problem, I’m working with wp and woocommerce and i have to populate the drodown menu like here (the old website) search website is dinamyc, help to the clients how to find a product, they have something like 10.000 products wines…
      any idea how to risolve this dropdown search?

      any help ?
      thankssss a lot

    • Pete 8:05 am on August 6, 2012 Permalink | Reply

      the form doesn’t submit?

      • Frankie Jarrett 10:40 am on August 6, 2012 Permalink | Reply

        Hi Pete, Since a dropdown of custom taxonomies could have many different uses, this tutorial is simply about how to create the dropdown, not how to make a form.

    • Daniel Martines 9:42 pm on August 9, 2012 Permalink | Reply

      Hi guys! I have a taxonomy that I share beetween 2 post types.
      I need to create a dropdown that shows the taxonomy from just one post type. Is this possible?

      Thanks!

    • Hane 11:43 am on November 20, 2012 Permalink | Reply

      I’m using method #2 and would like to know how I can make my drop down hierarchical. I added hierarchical => true to the $arg but its not working. Any help would be very much appreciated.

      Thanks
      Hanè

    • Matías 3:23 pm on January 30, 2013 Permalink | Reply

      Hi! First at all, thanks for your tutorial.

      I can’t get it working. I’m tryng to retrieve categories from WP e-commerce plugin (taxonomy = wpsc_product_category) and nothing is shown.

      Any ideas?

      Thanks in advance.

      ps: sorry for my english.

    • Eric 7:28 pm on April 12, 2013 Permalink | Reply

      Yea not getting this to work anymore. The form dont even show on page.

    • Edu 3:55 am on April 18, 2013 Permalink | Reply

      Simple and useful. Thanks

    • Musab 6:50 pm on May 3, 2013 Permalink | Reply

      How can I take advantage of that on my search results.

      For example, to as this menu next to the search box and filter results by the selected taxonomy category.

    • John 9:34 am on May 20, 2013 Permalink | Reply

      I have been struggling to create a custom real estate search for my website for weeks now. The function I’m trying to build is not complicated. I’m very familiar with WP and can follow directions very well. If any of you is willing to help I could pay you for an hour of work ($30) to help me figure this thing out. Please shoot me an email..

  • Frankie Jarrett 12:54 pm on August 23, 2011 Permalink | Reply
    Tags: chrome, mac, webkit   

    How to remove an auto-complete URL from Chrome on a Mac 

    If you’re at all like me, you get very annoyed at little things :)

    The Scenario

    Let’s imagine you love to browse with Chrome on your beloved Mac and you frequently visit Facebook. So you type the letters fa in your browser’s address bar and *bam!* the URL auto-completes to read facebook.com.

    It truly is a wonderful thing. But sometimes, it’s not so wonderful.

    The Problem

    Some users are reporting that when you first startup Safari or Chrome on a Mac the browser may take a while to load those auto-complete gems from your history. That’s not good when you’re used to typing fa and rapidly pressing Enter.

    Oops! Now you’ve just asked your browser to visit fa (which does not exist) and from this point on facebook.com will show up as the second auto-complete option. Yikes! How do we remove that darn fa entry now showing above the actual entry we want?

    There is hope.

    The Solution

    On a PC everyone seems to have the answer. You simply highlight the entry and press Shift + Delete. But us Mac users have an extra step that no one seems to be talking about.

    On a Mac, you need to highlight the entry and then press Fn + Shift + Del. Now, you might need to wait a bit, or restart the browser to see it removed but I found it to work perfectly.

    Did this work for you? Let me know in the comments.

     
    • Richard 5:07 am on September 20, 2011 Permalink | Reply

      Nope, doesn’t work for me. And I can well understand how this frustrated you. I love Chrome, but I think I’ll go back to Firefox on principle. (Well, for this and the fact that I just discovered it taking up 5GB of hard disk space because it archives every old copy whenever it upgrades itself – WTF?) Bah.

    • Frankie 11:52 am on September 20, 2011 Permalink | Reply

      Richard, sorry to hear it didn’t work for you. It’s still working for me. Didn’t know about the legacy archiving, where on the system are those folders being stored?

    • Clif Watson 10:22 am on December 5, 2011 Permalink | Reply

      THANKS!! I’ve been looking for this for awhile! A few times I’ve had to be patient for it to take effect, other times, it is fixed immediately. ONE thing I’ve been trying that may/seems to help the situation is begin typing the URL, arrow down to select the one I want to remove, do the shift, fn, delete keystroke then move the arrow to another of the Chrome provided suggestions (preferably the one that is correct) and then hit enter to go that url/search term. That seems to help with the removal of the bad one and sticking the correct one.

    • GUS 11:35 am on December 15, 2011 Permalink | Reply

      it worked perfectly for me!

    • 1suisse 6:00 am on March 2, 2012 Permalink | Reply

      ahhhhh fn+shift+del ! nice !! worked fine ! thank you very much !!!

    • Alex 1:47 pm on March 20, 2012 Permalink | Reply

      Ahh this is perfect! I have been trying to figure this out for ages. Thanks for the tip!

    • Anis 4:54 am on April 22, 2012 Permalink | Reply

      THANKS !
      (I needed this for PC and did not know about the Shift+Del thing)

    • mickey 9:33 am on April 24, 2012 Permalink | Reply

      I was pulling my hair out for a few days. This works like a charm. Thanks a bunch. I did find there are some things that cannot be deleted, although I don’t know yet why. I should note that for me it only works if I highlight the item with the mouse (if you scroll down with the keyboard, it will not work).

      • Frankie Jarrett 3:52 pm on April 30, 2012 Permalink | Reply

        Glad it worked for you. Thanks, Mickey!

    • Michael Therrien 11:39 am on June 5, 2012 Permalink | Reply

      I think Google broke this. I’m using OS X Chrome v.19.0.1084.53 and no key combinations seem to work.

      • Frankie Jarrett 4:56 pm on June 6, 2012 Permalink | Reply

        Hey Mike, I’m running Chrome v.19.0.1084.54 and it’s still working great for me, just used it today on a site that was defaulting to https instead of http like I wanted.

    • anon 1:08 am on June 6, 2012 Permalink | Reply

      thankyou thankyou thankyou thankyou!!

      my girl visits all these sites on my comp and then when i try to go to my usuals they are always buried

      you have prevented a catastrophe!

      • Frankie Jarrett 4:57 pm on June 6, 2012 Permalink | Reply

        Glad it helped you!

    • Tuncay 2:59 am on July 26, 2012 Permalink | Reply

      Thanks, i even didn’t know how to do that on windows

    • Rukayat 1:52 am on July 27, 2012 Permalink | Reply

      Thanks so much! Worked on a mac.

    • Ashu 8:46 am on September 17, 2012 Permalink | Reply

      Thanks so much. This worked for me on mac for some URLs.

    • Mich 2:07 am on September 20, 2012 Permalink | Reply

      Has worked ONCE, but doesn’t work now, even after a reinstall of chrome it’s still there! it must be somewhere outside chrome.

    • ronjerm 10:02 pm on September 22, 2012 Permalink | Reply

      I am deleting Chrome from my system. This is worrisome since the tracking is outside my local machine. Back to Firefox.

    • john 9:46 am on September 25, 2012 Permalink | Reply

      hey, i want to delete http://www.facebook.com stored in chrome, no matter i clear browsing history it pops out the same as http://www.google.com does. please help me

    • jubal 1:44 am on October 4, 2012 Permalink | Reply

      seems shift + delete now works! ( on chrome 22+ )

    • Joe Mahma 10:40 am on October 5, 2012 Permalink | Reply

      Nope.

    • carl 7:54 am on October 7, 2012 Permalink | Reply

      I’m using a keyboard for Mac, but the keyboard doesn’t have the single “FN” key. Any work around?

      Thanks

    • Gib Wallis 11:03 am on October 7, 2012 Permalink | Reply

      This doesn’t work for me either. I’m on Snow Leopard, on a MacBook Pro.

      Maybe there’s a different keystroke for laptops because the Fn key means something different?

    • Jess 5:13 pm on October 8, 2012 Permalink | Reply

      I have been trying th Fn + shift + delete, but my mac doesn’t have a delete button. can someone help me please? >.<

    • Michael Holroyd 2:16 pm on October 10, 2012 Permalink | Reply

      Pro tip! Totally works for me!

    • Denzel 11:51 pm on October 27, 2012 Permalink | Reply

      This is actually quite annoying, I’ve been trying to get rid of these automated suggestions on my omni-bar/url bar whatever it’s called and I can’t seem to find a fix -.- none of this ‘shift+del’ etc. works, and clearing the history, cache, n everything else does not work either :/ any idea?

    • BrianMB 1:28 pm on November 7, 2012 Permalink | Reply

      This worked at one point, but currently does not (v23).

    • tom28 11:17 am on November 10, 2012 Permalink | Reply

      Doesn’t work on my MacBook Pro with Chrome. Shift + Del or Fn + Shift + Del just deleteing the last letter of typed address, like no no Shift or Fn is pressed.

      Any other idea how to delete auto fill urls?

    • cameron 3:25 am on November 20, 2012 Permalink | Reply

      This does not work on my MacBook Pro running Chrome in Snow Leopard. Extremely frustrated.

    • Tim Kierse 2:12 am on December 17, 2012 Permalink | Reply

      Worked for me on Firefox on a mac. I have to add it was bugging the hell out of me having just moved over from a Win laptop.

    • Yutaka 1:28 am on December 26, 2012 Permalink | Reply

      Thank you! Your tip worked for me on Chrome 23, on OS X Mountain Lion.

    • Chris 2:11 pm on January 16, 2013 Permalink | Reply

      Finally, THANK YOU!!!

    • Doug 10:01 pm on January 28, 2013 Permalink | Reply

      I don’t understand why anyone would want to type in “fa” every time they want to navigate to facebook.com. This is what bookmarks are for. I hate this feature of chrome (more just that I can’t turn it off). I’m one of those people who uses the internet for lots of things, not just for email and facebook, and when i type “face” I expect a search for faces. Instead, I constantly find myself backspacing google’s #*%king autocompletes so I can search for what I ACTUALLY TYPED.

      • Frankie Jarrett 5:10 pm on February 15, 2013 Permalink | Reply

        But of course, if you search the web for “face” you will only discover that Facebook is the first result :)

        You should also notice that during autocomplete Chrome will actually have the remainder of an autocomplete URL highlighted, this allows you to easily exit the autocomplete process and search the web using just two keystrokes.

        For example, type the word “face” and then press the “Delete” key. Since “book.com” was already highlighted, pressing the Delete key has now removed it from the URL bar and now upon pressing “Return/Enter” Chrome will search Google for the word “face”.

        There are probably a few hundred sites I frequent during a typical day of browsing, having to scroll through bookmarks does not sound like a robust solution. I think Chrome’s autocomplete feature is quite handy for the needs of most power-surfers, but occasionally, there is a slip of the keystroke and knowing how to delete an autocomplete entry on a Mac is helpful.

        I hope you find this helpful and are able to use Chrome’s autocomplete to your advantage.

    • luca 6:20 am on February 13, 2013 Permalink | Reply

      thanks!!! very helpful!!!

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel