How to add the logged-in user’s roles as classes in the body element in WordPress

To add the user roles to the body of your WordPress pages, you can use the body_class hook. This hook allows you to add custom classes to the <body> element of your pages. Example of body_class hook to add classes to the body element Here’s an example of how you can use this hook to […]
How to redirect from www to non-www URL using Cloudflare for free

After doing a quick SEO audit to this website, I found that https://davidloor.com/ and https://www.davidloor.com/ were both up. Since search engines see them as two different websites, it may arises issues because of duplicated content. So, I needed to pick one of the domains and redirect the other to the one selected. On the internet […]
How to add custom CSS to the admin area in WordPress

1.- Create a css file in your custom theme where you want to add the styling. 2.- Implement the admin_enqueue_scripts action in a custom plugin or the functions.php file of your theme, like this:
How to change the meta title of the WooCommerce shop page using the Rank Math plugin

In a WooCommerce site that I am working on, I tried to update the meta title of the default shop page from the Rank Math configuration page and for some weird reason I was not able to accomplish it. So, at the end, I needed to use the following snippet to make it happen: If […]
How to check quickly if your website is protected against DoS attacks?

The objective of this quick how-to is to explain how to perform a stress test against your site and see how it behaves under extreme load. The Open Source tool that we are using for this test is the HTTP benchmarking tool wrk.
How to redirect users after they login based on their role on WordPress

If your WordPress site/project needs the users to be redirected to different pages after they successfully login, based on their roles, you can use a plugin or the code below
How to setup a WordPress or Drupal site locally with ddev

DDEV is an open source tool that allows setting up local sites using docker, quickly. You will learn from my experience with it about how to use it, and some helpful commands.