Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
wordpress deletes <sup> on save comment

I'm trying to implement an WYSIWYG editor to my WP comment section. I experience many difficulties with saving the HTML data in the WordPress database. WP strips many of the HTML tags automatically. I was able to restore the

tags trough the 'preprocess_comment' filter. I added the wpautop() filter to the content. Now the line breaks are appearing. But when I want to use the tag, WordPress deletes is too.

I use the Trumbowysiwyg js solution to replace the default comment textarea with the wysiwyg editor. When using the editor, the HTML code looks nice. It has all the HTML tags but after saving the comment, these tags are stripped. Can someone tell me how to allow HTML comments to be saved in the database?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

WordPress keeps a list of allowed tags which you can use in comments, surely you do not want users to post any html they want. So I suggest you edit the allowedtags so they will not be removed.

add_action('comment_post', 'allow_more_tags');

function allow_more_tags() {
   global $allowedtags;
   $allwedtags['sup'] = array('class'=>array());
} 

Like this you can add any tags you like and even allow certain classs to be added to them.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!