0

I've inherited a wordpress website I need to maintain. Despite having upgraded it to the latest version (5.03), and having changed the theme, there seems to be some customisations which survived. These seem to be CSS related, affecting the general page template, as well as a specific plug-in. I would like to remove these customisations.

I am not a wordrpess dev, any pointers as to where to look would be appreciated.

3 Answers 3

2

When you inspect elements on the affected pages, it should tell you which CSS file is enforcing the rule. If the file is somewhere inside /wp-content/plugins/ then a plugin is adding them and you can either disable that plugin or see whether they have properly enqueued the CSS. If inside the plugin the style is added like this:

wp_enqueue_style(...);

and you need the plugin's functionality, just not the styles, you can create a child theme and inside its functions.php file add

add_action('wp_enqueue_scripts', 'wpse_325875_dequeue_plugin_css');
function wpse_325875_dequeue_plugin_css() {
    wp_deregister_style(...);
}

(replacing the ... with the same name the original plugin uses, so that it dequeues that particular file.)

Another possibility is that the dev before you may have modified Core files, which would be somewhere inside /wp-content/admin/ or /wp-content/includes/. Usually updating Core fixes this type of problem, but you can also manually download the .zip file from wordpress.org and overwrite your wp-admin and wp-includes folder. (Be careful not to overwrite wp-content as that contains all of your plugins as well as media uploads, like jpgs and pdfs.) That will ensure you're using non-modified Core files.

As with any changes, make sure you have a complete backup of both files and database before making changes. :)

0

You can verify by turning off all the plugins one by one. If issue is still present then you can comment the css file one by one from the functions.php. You can use the sign "//" double forward slash for commenting the php code.

-1

It's hard to say more without seeing it, but you could also check in Appearance > Customize > Additional CSS. This is the only place you can make changes (within the WP Admin, that is) that will persist through a theme update or switch (note that these theme changes are saved per-theme and would only return when you switched back to that theme).

Otherwise it would have to be a plugin or a core code change, as WebElaine mentioned.

2
  • Additional CSS is saved per-theme, and would not persist if the user changed theme. Commented Jan 18, 2019 at 0:28
  • I should have pointed that out, I was trying to describe that a themes' changes would get saved but didn't mean to suggest that they would persist into the next theme. Will edit.
    – rsigg
    Commented Jan 21, 2019 at 16:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.