Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've recently upgraded to WordPress 3.0, and am having a lot of problems with the autocomplete function when editing posts via 'quick edit' (e.g. /wp-admin/edit.php) - for example, editing tags. The autocomplete box often obscures the textbox I'm trying to enter text into, and sometimes gets 'left behind' once the 'update' button has been clicked.

Is there a way to disable the autocomplete?

UPDATE

To clarify, this is a Wordpress autocomplete feature, not a browser-based one.

UPDATE 2

It looks as if I need to remove the 'suggest' argument to "load-scripts.php", referenced at the bottom of each admin page like so:

<script type='text/javascript'
  src='http://www.example.com/path/to/wordpress/wp-admin/load-scripts.php?c=1&amp;load=hoverIntent,common,jquery-color,suggest,inline-edit-post'>
</script>

That seems to be generated by:

do_action('admin_print_footer_scripts');

but I lose the code trail at that point - anyone?

share|improve this question
    
Autocomplete is a feature of the browser itself, so knowing which browser (and which version) you're using would help ... –  EAMann Aug 12 '10 at 0:05
    
Are you sure it's WordPress autocomplete? Do you get a different result with a different browser? –  artlung Aug 12 '10 at 0:38
    
Come to think of it, what browser are you seeing this behavior in? –  artlung Aug 12 '10 at 0:39
    
Happens in both Firefox and IE –  Bobby Jack Aug 13 '10 at 11:09
add comment

4 Answers

up vote 4 down vote accepted
+25

I have a solution I tested, and it works.

The autocomplete for the tags is currently done via an ajax request to the file admin-ajax.php. The solution I would suggest is to block the processing of the request so that it does not return any result. I would do :

function no_tag_suggest() {
    if( DOING_AJAX == true && $_GET['action'] == 'ajax-tag-search' && $_SERVER['HTTP_REFERER'] == admin_url( 'edit.php' ) ) {
        die;
    }
}    
add_action('admin_init', 'no_tag_suggest');

The previous function verify:

  1. if it is an ajax request
  2. if the action paramater is 'ajax-tag-search'
  3. if the referer url is the '/wp-admin/edit.php' page

If these 3 conditions are meet, no result will be returned and the tag suggestions not displayed.

If you want to remove this autocomplete from all the pages, not the 'wp-admin/edit.php' only, you can do:

function no_tag_suggest() {
    if( DOING_AJAX == true && $_GET['action'] == 'ajax-tag-search' ) ) {
        die;
    }
}    
add_action('admin_init', 'no_tag_suggest');

I would suggest you to look at the code of 'admin-ajax.php' to see all the 'action' parameters there, thus all the ajax requests you can kill with similar methods.

I hope my explanation was clear. Don't hesitate to ask me if you want more details or have any question.

Bounty for me? :)

share|improve this answer
    
This looks very close to an excellent answer, BUT ... it doesn't work for me. The values of the referrer and the admin url are the problem - the former is being reported with the query params (edit.php?post_type=post&) whilst the latter is just 'edit.php'. I've fixed that with a call to strpos() and a check on '=== 0', but if you can think of a better way, please include it. With that in place, it works - almost - perfectly. –  Bobby Jack Sep 6 '10 at 11:48
    
There's still scope for someone to improve on this answer, although it's the best so far. Ideally, there would be a nice clean way of disabling the ajax request in the first place. –  Bobby Jack Sep 6 '10 at 11:49
add comment

You can either disable it in your browser or route around the WP source and slap this autocomplete attribute in the offending box:

<input autocomplete="off" />

Alternatively you could use greasemonkey to modify the page to disable autocomplete in the way mentioned above.

share|improve this answer
    
This is a wordpress autocomplete feature. Do you know if it inspects that property first, though? –  Bobby Jack Aug 13 '10 at 10:59
add comment

You can use this plugin:

Tag Uncomplete

http://wordpress.org/extend/plugins/tag-uncomplete/

Its intended for people who have a very large number of tag terms, but it does exactly what your wanting

share|improve this answer
    
I've tried that, but it doesn't appear to work. The plugin's quite old, and only mentions wordpress 2.5, so I'm guessing it's due an upgrade. The source is very simple, so I might be able to 'port' it over to wordpress 3 - will take a look. –  Bobby Jack Sep 3 '10 at 10:26
add comment

You can disable a response from the server, as sorich87 has explained, or you could try the (more complicated) way of disabling the javascript that starts the AJAX request. If you just remove the suggest library, the various places that call the suggest function will probably fail, so you should replace it with a stub function that does nothing.

share|improve this answer
    
I would, certainly, prefer to do that. However, it would be nice to do that in as clean a way as possible - currently, I feel sorich87's solution is less intrusive than renaming files, etc. The method used to load the suggest library REALLY implies there must be a nice flexible way of disabling it ... –  Bobby Jack Sep 6 '10 at 11:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.