Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9280485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:52:56+00:00 2026-06-18T17:52:56+00:00

I have a WordPress multisite installation and part of the feature is to load

  • 0

I have a WordPress multisite installation and part of the feature is to load CSS (a one-time copied version from the parent and child CSS file) stored in the database (WordPress options table part of theme options). This feature is available in the theme options panel.

Once this feature is enabled, the parent and child CSS are disabled and the theme will load from custom css file(custom.css). The content of this custom.css is taken from the database (like what I’ve said in the first paragraph). In the theme options panel, users can now edit the entire CSS and then saved it. Once saved, it will write to a custom.css file with the changes.

I need your thoughts if this method is secure. Basically I have sanitized the custom CSS (before it will be saved to the database) using the following PHP lines:

$sanitized_css = esc_html($original_css);

Where esc_html is a WordPress function for escaping HTML blocks: http://codex.wordpress.org/Function_Reference/esc_html

But I am not sure if this is really the best method. I would appreciate your advise and thoughts.

I am thinking to output the CSS to the browser directly (inline) not using any CSS file, does this method also secure? But I know loading from CSS file is always the best practice especially for large CSS files.

I need to make sure that the application is safe from XSS, MySQL injection and other security risk.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:52:57+00:00Added an answer on June 18, 2026 at 5:52 pm

    A quick google search would bring the related post from this forum:

    User-defined CSS: What can go wrong?

    Sanitize user defined CSS in PHP

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Wordpress multisite installation with these websites: A portal: http://www.gprsoftware.nl which links
1) I have a Wordpress multisite subdomain installation with about 100 sites in the
I have a website with Wordpress 3.0.4 installation, set up as multisite install. Some
I have setup a wordpress multisite blog that is load balanced over 5 servers
I have a project and will be using Multisite feature of WordPress. I have
I have a WordPress site which have 4 pages with one page is a
I'm attempting to setup a Multisite Wordpress Network, but one of the requirements is
I have a network of about 200 blogs (Wordpress Multisite), and all of them
I have WordPress Multi site installed and all the same sites are using one
Our company is trying to transition to WordPress Multisite but we have several issues

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.