How To Disable HTML In WordPress Comments | Disable Comments In Wordpress

Опубликовано: 23 Октябрь 2024
на канале: Digital Suncity - Awesome Tutorials
86
3

Do you want to disable HTML in WordPress Comments?🤔

►In this video, you’re going to learn a simple but essential task for your WordPress website. As we know, WordPress is a powerful platform for building websites, and it provides the capability to let users leave comments on your posts.

►But sometimes, these comments may contain HTML code, which can pose security risks or alter the look of your site. That's why you'll see How To Disable HTML In WordPress Comments. Whether you're a beginner or an experienced WordPress user, this tutorial will be useful and straightforward.

So, sit back, grab a cup of coffee☕, and let's get started.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

🎓 Join My Web Design Academy ► https://divisuccess.com/bonus
📺 Need Help? Contact Me ► https://www.digitalsuncity.com/help
🎁 VIP Stuff ► https://www.digitalsuncity.com/vip 💰

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Step 1 - Introduction 00:21
Step 2 - Hover on to Appearance and click on Theme Editor 00:44
Step 3- Now click on Theme Functions 00:49
Step 3 - Entering the code 01:10
Step 4 - Click on Update File 01:23
Step 5 -Visit Website and check the modified changes 01:29

Also Read: https://digitalsuncity.com/how-to-dis...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▼ Code▼
// 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;
}

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

▼ More Awesome Videos ▼
👉 Change the Default URL Slug in WordPress ►    • How To Change The Default Search URL ...  
👉 Add Specific Posts to the navigation menu in WordPress ►    • How To Add Specific Posts To WordPres...  
👉 Add Title attributes in WordPress ►    • How To Add Title Attribute In WordPre...  
👉 Force Logout All Users in WordPress ►    • How To Force Users To Login Before Re...  

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

👋TALK TO ME ON MY SOCIAL MEDIA! 👋
Instagram ►   / harshitbhootra  
Facebook ►   / harshit.bhootra  
Twitter ►   / bhootraharshit  
LinkedIn ►   / harshitbhootra  

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

👉Give a thumbs up👍and subscribe to our YouTube Channel to stay updated on our latest tutorials and videos🎥 So make sure to turn on notifications🔔to never miss a video.
Thanks for watching!
#wordpresscomments #disablecomments #htmlcomments