The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other pre tag

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #43093

    i have a wordpess site and my users should be able to post code snippets into their comments(like here in css-tricks). i am the site administrator so i dont have a problem with showing codes and using pre tags but when i comment to a post as a guest user i can not see code with styling! by using chrome tools for developers i can see my codes surrendered with code tag but i wrote pre tag like what i did as i was admin! so what is the problem?!


    i have found kses.php in wp-include but it has all allowed html tags not just for guest user!


    You ought not to be modifying anything outside of `wp-content` anyway as this is core and so your changes will get overwritten when WordPress updates. To avoid, you should define a custom function in your theme to alter the default set of tags that are allowed. See [this tutorial]( “”) for more information.


    @mostafaghanbari ,

    If you want to try something client side, you can escape the characters they enter. Im sure there is a php (more secure) alternative.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.