Thank you for installing ATag

This plugin is free but man cannot live my code alone, so if you've found it useful and you want to say thanks. Please either donates via PayPal or by me something from my Amazon wish list.
amazon

Maximum number of tags per post (ex. 5)
Override existing tags /> Yes /> No

post_content; $content = apply_filters('the_content', $content); $rawData = str_replace(']]>', ']]>', $content); $rawData = strip_tags($rawData); $stopwords = array(' ',',','(',')','!','?',"`","\n","”","“"); $rawData = str_replace($stopwords, " ", $rawData); $rawData = str_replace("’", "'", $rawData); $rawData = preg_replace("/[^A-Za-z0-9' ]/","",$rawData); // need to strip common words array from the post information at or before this point // // Start of common word list // $wordlist = array("the","a","b","c","d","e","f","g", "of","and","a","to","in","is","you","that","you’re","h", "it","he","was","for","on","are","as","with","don't","j", "his","they","i","at","be","this","have","from","it's", "or","one","had","by","word","but","not","i'd","k","l","m", "what","all","were","we","when","your","can","you’d","n", "said","there","use","an","each","which","she","o","p", "do","how","their","if","will","up","other","about","q", "out","many","then","them","these","so","some","her","s", "would","make","like","him","into","time","has","look","r", "two","more","write","go","see","number","no","way","t","u", "could","people","my","than","first","water","been","v","w", "call","who","oil","its","now","find","long","down","x","y","z", "day","did","get","come","made","may","part","over","1","2","3", "new","sound","take","only","little","work","know","4","5","6","7", "place","year","live","me","back","give","most","very","8","9","0", "after","thing","our","just","name","good","sentence","you're", "man","think","say","great","where","help","through","that's", "much","before","line","right","too","mean","old","you'd", "any","same","tell","boy","follow","came","want", "show","also","around","form","three","small","set","put","end", "does","another","well","large","must","big","even","such","because","turn", "here","why","ask","went","men","read","need", "land","different","home","us","move","try","kind","hand","picture", "again","change","off","play","spell","air","away", "animal","house","point","page","letter", "mother","answer","found","study","still","learn","should","america", "world","high","every","near","add","food","between", "own","below","country","plant","last","school","father", "keep","tree","never","start","city","earth","eye", "light","thought","head","under","story","saw","left", "don't","few","while","along","might","close","something", "seem","next","hard","open","example","begin","life", "always","those","both","paper","together","got", "group","often","run","important","until","children", "side","feet","car","mile","night","walk","white", "sea","began","grow","took","river","four","carry", "state","once","book","hear","stop","without","second", "later","miss","idea","enough","eat","face","watch","far", "indian","really","almost","let","above","girl","sometimes", "mountain","cut","young","talk","soon","list","song", "being","leave","family","it's","body","music","color", "stand","sun","questions","fish","area","mark","dog", "horse","birds","problem","complete","room","knew", "since","ever","piece","told","usually","didn't", "friends","easy","heard","order","red","door","sure", "become","top","ship","across","today","during","short", "better","best","however","low","hours","black", "products","happened","whole","measure","remember", "early","waves","reached","listen","wind","rock", "space","covered","fast","several","hold","himself", "toward","five","step","morning","passed","vowel", "true","hundred","against","pattern","numeral", "table","north","slowly","money","map","farm", "pulled","draw","voice","seen","cold","cried", "plan","notice","south","sing","war","ground","fall", "king","town","i'll","unit","figure","certain","field", "travel","wood","fire","upon"); // // End of common word list // $rawData = strtolower($rawData); foreach($wordlist As $current_word){ $rawData = preg_replace("/\s". $current_word ."\s/"," ",$rawData); } // $rawData = str_replace($wordlist, " ", $rawData); // and make tags rawdata lower case $wordsArray = explode(' ',$rawData); //$orderedArray = array_count_values($wordsArray); $orderedArray = array(); for($counter=0;$countervalue where key is the word and value is the number of occurances // pull out the keys relating to the n highest values from the array and put them into a commer seperated string // where n is the number of tag per post (defult to 5, but should be user defined) arsort($orderedArray); reset($orderedArray); $newTags = ""; if(get_option('autoTag_number') != ""){ $numberOfTags = get_option('autoTag_number'); } else { $numberOfTags = 5; } for($counter=0;$counter<$numberOfTags;$counter++){ if (key($orderedArray) != "") { $newTags = $newTags . key($orderedArray) . ", "; } next($orderedArray); } trim($newTags,' '); trim($newTags,','); if(get_option('autoTag_option') != ""){ $replace = get_option('autoTag_option'); } else { $replace = "true"; } wp_set_post_tags( $post_id, $newTags, $replace ); }