WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Simple Tags] Auto Terms/Auto Tags - should find whole words (8 posts)

  1. wp.Man
    Member
    Posted 4 years ago #

    overall i have to say this is really a great plugin, however the one major problem i have with it is the way Auto Tags/Auto Terms works.

    if you have a tag 'CIA' in your keyword list and a post with the word 'facial' in it, it gets tagged with 'CIA'. this can cause a huge number of non-relevant tags to be assigned to posts which can only frustrate readers and, i assume, is not good for SEO either.

    until this is resolved, if the dev chooses to do so, i'm wondering if anyone can provide a quick hack to force Auto Tags to only consider whole words?

    i've poked around in the code a bit but i'm not familiar enough with PHP to even find the relevant code.

    http://wordpress.org/extend/plugins/simple-tags/

  2. wp.Man
    Member
    Posted 4 years ago #

    had another stab at looking through the code and found this in 'admin.php', line #235:

    function pageAutoTags() {
    		$action = false;
    		if ( isset($_POST['update_auto_list']) ) {
    			// Tags list
    			$tags_list = stripslashes($_POST['auto_list']);
    			$tags = explode(',', $tags_list);

    and #276:

    $tags_list = '';
    		$tags = maybe_unserialize($this->options['auto_list']);
    		if ( is_array($tags) ) {
    			$tags_list = implode(', ', $tags);
    		}

    seems like one or both of these lines is where change needs to be made???

    $tags = explode(',', $tags_list);
    $tags_list = implode(', ', $tags);

    any help is appreciated

  3. wp.Man
    Member
    Posted 4 years ago #

    i'm lost i think. found this on line #937 - the 'regexEscape' looks interesting, but i don't know what i'm looking at for sure :)

    // Return Tags
    		$matches = $tags = array();
    		preg_match_all('/(' . $this->regexEscape($this->options['start_embed_tags']) . '(.*?)' . $this->regexEscape($this->options['end_embed_tags']) . ')/is', $object->post_content, $matches);
    
    		foreach ( $matches[2] as $match) {
    			foreach( (array) explode(',', $match) as $tag) {
    				$tags[] = $tag;
    			}
    		}
  4. wp.Man
    Member
    Posted 4 years ago #

    any advice would be appreciated

  5. wp.Man
    Member
    Posted 4 years ago #

    still hoping someone can help

  6. GATEKeeper
    Member
    Posted 3 years ago #

    The larger problem I just discovered is that the autolink feature, while helpful, breaks video because it also tries to add autolink to file URLs.

    Obviously this is a huge problem, and wp.Man is right, replacing whole words only would help, but the code should also automatically avoid replacing words within code.

    I've seen issues as well where the autolink feature replaces links in galleries.

    Perhaps some of these issues can be addressed for the next update? Anyone have advice on keeping autolink on but keeping it from messing up video/links?

  7. GATEKeeper
    Member
    Posted 3 years ago #

    Kind of surprised more people aren't complaining about this. It's a pretty huge flaw if you post video.

  8. microtag
    Member
    Posted 3 years ago #

    Is it possible validate keywords separated by commas?
    Example: apple and apple,
    if the word apple is set to a comma is not inserted tag.

Topic Closed

This topic has been closed to new replies.

About this Topic