Category Archives: WordPress

Disabling a WordPress Plugin via Command Line

Ever look on in horror as your WordPress site crashes with no obvious reason? I have, and this time I’m writing down what I did 🙂

First I checked the logs using Docker (if you’re not running via Docker… you should be)

docker logs [container]

Hopefully that gives you some clues. In my case there were errors all over the place pointing at a particular plugin, so 1st I had to access the bash shell for that container like so…

sudo docker exec -it [container] /bin/bash

From there, simply cd to the plugin directory and rename the directory…

cd wp-content/plugins/
mv [plugin] [plugin]-off

Which should allow things to start running again. At a minimum the plugin should be disabled, and if not working you can continue the hunt.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Exclude Categories from WordPress Feed

Want to keep posts from a given WordPress category or categories out of your public feed?  If so, just edit the template’s functions.php file and append this code…

function myFeedExcluder($query) {
 if ($query->is_feed) {
   $query->set('cat','-12');
 }
return $query;
}

add_filter('pre_get_posts','myFeedExcluder');

This code will keep the category ID=”12″ out of the feed. If you want to exclude more than one category, put them in separated by commas ‘-12,-25,-33′.

Thanks to this page for this tip!Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.