Skip to main content
WordPress Snippet

Protecting Your User Endpoints in the WordPress REST API

If you're using the WordPress REST API, you may want to protect certain endpoints from unauthenticated access. The user endpoint is particularly sensitive, as it can contain sensitive information such as email addresses and usernames. In this blog post, we'll… Read more
WordPress Snippet

Output Users of a Specific Role in the Yoast Sitemap : WordPress Code Snippet

The following code will only return authors of a specific role from the generated Yoast XML sitemap. In the example, users of the 'editor' role are returned. Add the following to your functions.php file: /** * Filter Yoast authors -… Read more
WordPress Snippet

Custom WP_Query SQL WHERE Clause using posts_where : WordPress Code Snippet

There may be times when you need to add to the WHERE clause within a WP_Query call for additional SQL filtering that cannot easily be achieved via the standard parameters. The following is a simple example that passes through a… Read more