WordPress Comments Me Auto Linking URLs Ko Disable Kaise Kare

1
14

WordPress blog par comments karte waqt jab koi commentator text URL bhi add deta hai to WordPress ise automatically clickable link me convert kar deta hai. Jise unlink karne ke liye admin ko manualy us link ko remove karna padta hai. Lakin kya aapko pata hai ek aisa bhi coding trick hai, jisse WordPress comments me se auto linking URLs ko disable kar sakte hai. Jiske bare me aaj hum is post me janege.

Jab hum hosting par new WordPress blog install karte ho to posts/pages comments section me auto linking URLs feature automatically activated hota hai. Iska fayda aur nuksan dono hote hai.

Fayda ye hai ki isse other users ko us link pe click karke other page pe jane me asaani rehti hai. Par dusri taraf nuksan ki baat karu to wo ye hai ki agar aapki site par spam comments ate hai, tab site ki seo ranking par bad effect pad sakte hai. Jo koi blogger nahi chahega.

WordPress comments me auto linking disable karne ke baad agar koi aapke blog pe comment me koi link mention karega to wo link automatically remove ho jayega aur sirf ek text ki tarah show karega. Iske aapko bhi 2 fayde hote hai.

Ek to wo bloggers jo sirf apni site ki promotion ke liye comments karte hai, wo nahi kare, 2nd aapki site pe spam comments ane bhi band ho jayege.

WordPress blog par comments me auto linking URLs ko disable kaise kare? No more spam links

Auto linking URLs me basically simple plain text and html tag link 2 tarah ke links hote hai. Jise coding se disable karne ka tarika yaha mai aapko niche bata raha hu. jise bas aapko apne WordPress theme ki functions.php folder me add karna hai.

Bonus Tip: Agar ap chahe to auto linking URLs disable karne ke liye No comments links plugin bhi use kar sakte ho.

Simple Plain Text Links

Ye wo links hote hai jo directly kisi webpage ke address bar copy kiye hite hai. Jaise http://www.harpreetkumar.in/customize-jetpack-sharing-buttons/. Agar aap is type ke clickable text links ko disable karna chahte ho to apne blog ke dashboard >> Appearance >> Editor me theme ke functions.php folder me niche likha code copy karke paste kare.

//Disable URL Auto-Linking in WordPress Comments
remove_filter( 'comment_text', 'make_clickable', 9 );

Ab aapke blog post pe jab koi user comment me text URL add karega wo link automatically simple text me convert ho jayega. Jisse spamming ke chances kam hote hai.

By the way, in future agar aap kabhi fir se auto linking feature ko enable karna chahe to theme functions.php folder se code ko remove kar sakte hai.

HTML Tag  Links

Ye wo link hota hai jise html tag ki help se likha jata hai. Jaise <a href=”http://www.harpreetkumar.in/jetpack-plugin/”>Jetpack Plugin</a>. Aise tag se jab koi user comment karta hai to <a> & </a> ke bich likha hua text clickable link show hota hai.

So remember, upar bataye coding trick se aap sirf simple plain text links ko disable kar sakte hai. Agar aapko apne WordPress comments se HTML tag links ko bhi remove karna hai to aap niche likha code apne WordPress blog ke dashboard >> Appearance >> Editor me theme me jakar functions.php folder me paste kare.

// This will occur when the comment is posted
 function plc_comment_post( $incoming_comment ) {
 // convert everything in a comment to display literally
 $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
 // the one exception is single quotes, which cannot be #039; because WordPress marks it as spam
 $incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );
 return( $incoming_comment );
 }
 // This will occur before a comment is displayed
 function plc_comment_display( $comment_to_display ) {
 // Put the single quotes back in
 $comment_to_display = str_replace( ''', "'", $comment_to_display );
 return $comment_to_display;
}

Iske bad aapki site par comments me kisi bhi tarah ka html code add karne par work nahi karega. By the way, agar aap coding se auto linking disable nahi karna chahte to aap Peter’s Literal Comments plugin ka istemal kar sakte ho. Jisse aapko theme me extra coding customization ki jarurat nahi padhegi.

I hope ab aapko WordPress blog comments se auto linking URLs ko disable karke spam comments ko dur rakhne me help milegi. Kyuki upar diye code ko apni WordPress theme me add kar lene ke baad koi bhi plain text ya HTML tag links ko comments me add nahi kar payega.

Agar ye post se aapko achi jankari mili to apne social media sites par dusre bloggers ke sath jarur share kare. Www.harpreetkumar.in par future me publish hone wale articles ki jankari direct apne email inbox me pane ke liye aaj hi subscribe kare.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here