Technical Entry Level

Explain the difference between actions and filters in WordPress. How does the hook system work, and how do you decide which to use?

Quick Tip

Show the key distinction: "Actions let me run code at a specific moment, like sending an email after a post is published. Filters let me modify data in transit, like changing the post title before it renders."

What good answers include

Actions execute code at specific points without returning a value — they fire and forget. Filters modify data by passing it through a chain of callbacks and returning the altered result. Both use the same underlying hook system (WP_Hook class). add_action/add_filter register callbacks; do_action/apply_filters trigger them. Priority controls execution order. Strong candidates discuss: remove_action/remove_filter for overriding third-party behaviour, the importance of accepting and returning the correct number of arguments in filters, and naming conventions for custom hooks.

What interviewers are looking for

Fundamental WordPress knowledge. Candidates who cannot clearly distinguish actions from filters will struggle with any non-trivial WordPress development. Ask them to name hooks they use regularly and why.

← All WordPress questions