Web Prepration

Web Concept Tutorials


Hooks in WordPress allow developers to easily tie their own code in with the WordPress core code base, themes, and plugins. In this post, we’ll discover what hooks are, go over the different types of hooks, and look at a few examples of hooks in action and filters hooks.

Hook is a generic term in WordPress that refers to places where you can add your own code or change any existing functionality using hooks what WordPress is doing or outputting by default.

There two types of hooks in wordpress

  1. Action hooks
  2. Filter hooks

Action Hooks

An Action hooks in WordPress is a hook that is triggered at specific time when WordPress is running and lets you take an action. This can include things like creating a widget,shortcode,custom post types etc.

Example of Action Hook


Filter Hooks

Filter hooks in WordPress allows you users to get and modify any existing functionality of  WordPress  before it is sent to the database or the browser. Some examples of filters. There are lots of action hooks if you want to learn all functions then click here

Example of filter hook


How to Unhook from Actions and Filters

How to remove any functionality using hooks in themes or plugins

Example of remove action hooks


Example of remove Filter hooks


There are some other action hooks example like add menu in admin section


5 comments on What is hooks and how to use hooks in wordpress

  • furtdsolinopv

    I haven?¦t checked in here for a while because I thought it was getting boring, but the last few posts are great quality so I guess I will add you back to my everyday bloglist. You deserve it my friend 🙂

  • Rosalba Duntley

    You actually make it appear really easy together with your presentation but I find this matter to be really one thing which I believe I would by no means understand. It kind of feels too complex and very extensive for me. I’m looking forward to your subsequent submit, I will attempt to get the hold of it!

Write a comment

Your email address will not be published.