Admin vs frontend context
Every WordPress request is one of two things: an admin request or a frontend request. This sounds obvious, but it has real consequences for how you write and debug code — and for how you diagnose support tickets.
When someone visits your site’s public pages, WordPress handles a frontend request. When someone visits yoursite.com/wp-admin/, WordPress handles an admin request. These are not just different URLs. They are different execution paths. Different templates load, different scripts and styles are enqueued, different hooks fire, and different globals are available.
The function is_admin() tells you which context you are in. It returns true for any request routed through wp-admin, including AJAX requests that go through admin-ajax.php. It returns false for everything on the frontend.
This matters constantly in support work. A plugin that breaks only in wp-admin is scoped to the admin context. A plugin that breaks only on the frontend is scoped to the other. Being able to immediately narrow down which context a bug lives in cuts your debugging time in half.
One thing that trips people up: is_admin() is about the URL path, not about user capabilities. A logged-out user hitting a wp-admin URL still returns true from is_admin(). A site administrator browsing the frontend returns false. These are two completely separate concepts. is_admin() answers “where is this request going?” not “who is making it?”
In real plugin code you will regularly see hooks registered conditionally — only in admin, or only on the frontend. This keeps code where it belongs, avoids loading unnecessary logic, and makes plugins easier to reason about when something goes wrong.