• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How To Override/Block Independent Comment Styling By Commenters

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › General Genesis Framework Discussions › How To Override/Block Independent Comment Styling By Commenters

This topic is: not resolved

Tagged: comment form, comments, pre_comment_content, preprocess_comment

  • This topic has 2 replies, 2 voices, and was last updated 4 months, 1 week ago by philphilerson.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 20, 2022 at 2:36 pm #505806
    philphilerson
    Participant

    Hello StudioPress forums.

    I am having an issue regarding comment styling (the font, size, and color of commented text is being altered by commenters).

    This happens on many different themes, but my primary theme is Magazine Pro (but I imagine the code needed to fix would work with many themes, which is why I put this in general).

    I have a default comment styling selected for comments that is used whenever someone directly types in the comment box and submits a comment. (By styling, I mean the color, font size, and style of text.) This styling works fine whenever someone types directly into the comment box.

    However, if a commenter copy and pastes text from a separate source, it uses the comment styling of the selected source. This allows commenters to manipulate/alter their comment to appear bigger or brighter compared to others, so now everyone is starting to do it.

    I have tested this, and, for example, where the selected external text is a header, or a larger font size, or a different color, or even from within my own article where the text is not normal paragraph text, it will default to that new selected text styling over my default styling. Then it will not follow my default comment styling.

    My question is—Does anyone know of any code that would require/demand the default text styling and override any copy/paste of outside sources?

    I found this link from 2019 which seems to indicate that it may be a theme issue (the theme allows it). If so, how can I change it for all comment styling in Genesis? - https://sites.stmarytx.edu/webelaine/2019/04/05/gutenberg-change-font-size-options/. Additionally, I'm not great at coding, so it'd be easier if it could be done on the CSS end.

    I am unable to share the website URL as it is a private website, so you wouldn't be able to see the comments, anyway. But here is an image I created to demonstrate the issue: https://imgur.com/a/W7B2wHt. I do use WPDiscuz, but this problem persists whether any plugins are active or not.

    Thanks for any help you can provide. Have a great week.

    September 21, 2022 at 3:44 am #505813
    Brad Dalton
    Participant

    Phil

    If you can disable/remove HTML tags from rendering in the comment form before comments are published then you can prevent inline styling.

    I would use str_replace with the correct comment form hook. This requires testing to work out which hook and method work best.


    Get Help – Book Consultation.

    September 21, 2022 at 11:23 am #505815
    philphilerson
    Participant

    Do you have any example code you could recommend that I could attempt to adapt to my specific use case? I'm not exactly sure how I would disable those tags or what to replace them with.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble