Adding custom markup

You are reading the documentation for Age Gate 2.x. Switch to the documentation for 3.x.

You can add custom markup to the Age Gate via two filters: age_gate_before and age_gate_after.


Adding content before the Age Gate. This is added inside the .age-gate-wrapper tag, either as the first element or after .age-gate-background if using a background image.

add_filter('age_gate_before', 'before_age_gate', 10, 1);

function before_age_gate($before){

  $before .= '<div class="custom-markup">';
  $before .= "<p>This is my custom content!</p>";
  $before .= '</div>';

  return $before;


Adding content after the Age Gate. This is added before the closing div tag of .age-gate-wrapper .

add_filter('age_gate_after', 'after_age_gate', 10, 1);

function after_age_gate($after){

  $after .= '<div class="custom-markup">';
  $after .= "<p>This is my custom after content!</p>";
  $after .= '</div>';

  return $after;


Note: Depending on your custom content, there could be unexpected results if using the default Age Gate CSS.