AdFlow icon
Ads & Monetisation

AdFlow hooks reference

AdFlow 1.6.1 has 19 actions and 61 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when AdFlow fires an action
add_action( 'adflow_ad_rendered', function( $unit, $context ) {
	// Your code runs here.
}, 10, 2 );

// Change a value AdFlow is about to use
add_filter( 'adflow_ad_markup', function( $output, $unit, $context ) {
	// Change $output here.
	return $output;
}, 10, 3 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • includes/class-simple-google-adsense-manual-ads.php line 499 · used in 4 places
    /**
     * Filters the final ad markup.
     */
    apply_filters( 'adflow_ad_markup', $output, $unit, $context );
  • includes/class-simple-google-adsense-manual-ads.php line 547 · used in 4 places
    /**
     * This action is documented in render_unit().
     */
    do_action( 'adflow_ad_rendered', $unit, $context );
  • includes/class-simple-google-adsense-manual-ads.php line 358 · used in 3 places
    /**
     * Filters whether this particular ad is output.
     */
    apply_filters( 'adflow_should_display_ad', true, $unit, $context );
  • includes/class-simple-google-adsense-manual-ads.php line 449 · used in 2 places
    /**
     * Filters the attributes of the wrapping `<div>`.
     */
    apply_filters( 'adflow_ad_wrapper_attributes', $wrapper, $unit, $context );
  • includes/class-simple-google-adsense-content-slots.php line 658 · used in 2 places
    /**
     * This action is documented in
     * Simple_Google_Adsense_Placements::render_page().
     */
    do_action( 'adflow_placement_options', $key, $slot, $name );
  • includes/class-simple-google-adsense-content-slots.php line 664 · used in 2 places
    /**
     * This action is documented in
     * Simple_Google_Adsense_Placements::render_page().
     */
    do_action( 'adflow_placement_settings_fields', $key, $slot, $name );
  • includes/class-simple-google-adsense-content-slots.php line 493 · used in 2 places
    /**
     * This filter is documented in Simple_Google_Adsense_Placements::sanitize().
     */
    apply_filters( 'adflow_sanitize_placement', $slot, $raw, $key );
  • includes/class-simple-google-adsense-caps.php line 342
    /**
     * Fires after AdFlow access was changed (Pro: audit log).
     */
    do_action( 'adflow_access_saved' );
  • includes/class-simple-google-adsense-ad-units.php line 918
    /**
     * Filters the ad diagnostics (Pro adds targeting and caps).
     */
    apply_filters( 'adflow_ad_diagnostics', $out, $unit );
  • includes/class-simple-google-adsense-manual-ads.php line 473
    /**
     * Filters whether the inline `adsbygoogle.push()` is printed. Pro's lazy
     * loading turns it off and pushes when the ad scrolls into view.
     */
    apply_filters( 'adflow_ad_inline_push', true, $unit, $context );
  • includes/class-simple-google-adsense-manual-ads.php line 419
    /**
     * Filters the attributes of the `<ins class="adsbygoogle">` element.
     */
    apply_filters( 'adflow_ad_ins_attributes', $ins, $unit, $context );
  • includes/class-simple-google-adsense-ad-units.php line 227
    /**
     * Filters the ad unit types. AdFlow Pro adds Google Ad Manager. Extra types
     * render through the `adflow_render_ad_type` filter.
     */
    apply_filters( 'adflow_ad_types', array( 'display' => __('Display ad', 'simple-google-adsense'), 'inarticle' => __('In-article ad', 'simple-google-adsense'), 'infeed' => __('In-feed ad', 'simple-google-adsense'), 'multiplex' => __('Multiplex ad (formerly Matched Content)', 'simple-google-adsense'), 'image' => __('Image banner (your own or a sponsor\'s)', 'simple-google-adsense'), 'text' => __('Text ad (headline, text and link)'... );
  • includes/class-simple-google-adsense-ad-units.php line 442
    /**
     * Filters a loaded ad unit. Pro stores extra keys (e.g. reserved height).
     */
    apply_filters( 'adflow_ad_unit', $data, $post );
  • includes/class-simple-google-adsense-ad-units.php line 794
    /**
     * Fires at the end of the Delivery box. Pro adds advertiser details.
     */
    do_action( 'adflow_ad_unit_delivery_fields', $data, $post );
  • includes/class-simple-google-adsense-ad-units.php line 722
    /**
     * Fires after the core ad unit fields. Pro adds its fields here.
     */
    do_action( 'adflow_ad_unit_fields', $data, $post );
  • includes/class-simple-google-adsense-ad-units.php line 977
    /**
     * Fires in the "Use this ad unit" box for own ads. Pro adds the advertiser
     * report link.
     */
    do_action( 'adflow_ad_unit_sidebar', $unit );
  • includes/class-simple-google-adsense-settings.php line 177
    /**
     * Filters whether any AdFlow ad may be output on the current request.
     */
    apply_filters( 'adflow_ads_allowed', $allowed );
  • includes/class-simple-google-adsense-ads-txt.php line 152
    /**
     * Filters the ads.txt body served by AdFlow.
     */
    apply_filters( 'adflow_ads_txt_content', implode("\n", $lines) . "\n" );
  • includes/class-simple-google-adsense-manual-ads.php line 167
    /**
     * Filters whether a shortcode may override the site's ad client.
     */
    apply_filters( 'adflow_allow_ad_client_override', $trusted, $ad_client, $post );
  • includes/class-simple-google-adsense-settings.php line 200
    /**
     * Filters whether the Auto Ads snippet is printed on the current request.
     */
    apply_filters( 'adflow_auto_ads_allowed', $allowed );
  • includes/class-simple-google-adsense-stats.php line 874
    /**
     * Filters the address used for abuse limits.
     */
    apply_filters( 'adflow_client_ip', $client, $remote );
  • includes/class-simple-google-adsense-content-slots.php line 202
    /**
     * Filters the fewest paragraphs kept between an extra in-content ad and any
     * other ad in the post. Never below 1, so two ads are never adjacent.
     */
    apply_filters( 'adflow_content_slot_min_spacing', 2 );
  • includes/class-simple-google-adsense-conditions.php line 250
    /**
     * Filters the current language for placement rules.
     */
    apply_filters( 'adflow_current_language', $language );
  • includes/class-simple-google-adsense-dashboard.php line 146
    /**
     * Filters the Dashboard cards. Pro adds live earnings.
     */
    apply_filters( 'adflow_dashboard_cards', $cards );
  • includes/class-simple-google-adsense-dashboard.php line 280
    /**
     * Fires at the top of the Dashboard sidebar (upgrade card in the free
     * version).
     */
    do_action( 'adflow_dashboard_sidebar' );
  • includes/class-simple-google-adsense-docs.php line 521
    /**
     * Filters the Docs sections (add your own articles).
     */
    apply_filters( 'adflow_docs_sections', $sections );
  • includes/class-simple-google-adsense-stats.php line 453
    /**
     * Filters the front-end script config (Pro adds the country lookup URL).
     */
    apply_filters( 'adflow_fx_config', array( 'url' => esc_url_raw(add_query_arg('k', self::token(), self::endpoint())), 'track' => self::is_enabled(), 'consent' => !empty($settings['wait_for_consent']), ) );
  • includes/class-simple-google-adsense-admin.php line 1010
    /**
     * Filters the health checks. Pro adds its own.
     */
    apply_filters( 'adflow_health_checks', $checks );
  • includes/class-simple-google-adsense-migrate.php line 329
    /**
     * Fires after ads were imported from another plugin.
     */
    do_action( 'adflow_imported', $this->log );
  • includes/class-simple-google-adsense-conditions.php line 225
    /**
     * Filters the languages a placement can be limited to.
     */
    apply_filters( 'adflow_languages', $languages );
  • includes/class-simple-google-adsense-frontend.php line 150
    /**
     * Filters whether the AdSense library is loaded without ?client=. Return false
     * to always use the tag Google shows in AdSense.
     */
    apply_filters( 'adflow_library_without_client', $excluded || $switched_off );
  • includes/class-simple-google-adsense-settings.php line 225
    /**
     * Filters whether manual ads are switched off on the current request. AdFlow
     * Pro uses it for the "No manual ads on this page" checkbox.
     */
    apply_filters( 'adflow_manual_ads_excluded', $excluded );
  • includes/class-simple-google-adsense-admin.php line 359
    /**
     * Filters the order of the AdFlow submenu (by slug).
     */
    apply_filters( 'adflow_menu_order', array( self::MENU_SLUG, 'edit.php?post_type=' . Simple_Google_Adsense_Ad_Units::POST_TYPE, Simple_Google_Adsense_Placements::PAGE_SLUG, Simple_Google_Adsense_Reports::PAGE_SLUG, 'adflow-earnings', self::SETTINGS_SLUG, self::PRO_SLUG, ) );
  • includes/class-simple-google-adsense-placements.php line 481
    /**
     * Filters the classes of <div>s whose paragraphs are not counted.
     */
    apply_filters( 'adflow_paragraph_skip_classes', array('wp-block-columns', 'wp-block-cover', 'wp-block-media-text', 'afx-unit', 'afx-group', 'afx-sched', 'adflow-ad', 'adsense-ad') );
  • includes/class-simple-google-adsense-placements.php line 293
    /**
     * Filters which ad unit a placement renders. Pro uses it for A/B rotation.
     */
    apply_filters( 'adflow_placement_ad_id', (int) $placement['ad_id'], $key, $placement );
  • includes/class-simple-google-adsense-placements.php line 334
    /**
     * Filters whether a placement displays. Pro adds device, taxonomy, visitor and
     * referrer conditions here.
     */
    apply_filters( 'adflow_placement_should_display', $display, $key, $placement );
  • includes/class-simple-google-adsense-placements.php line 165
    /**
     * Filters the placement types. AdFlow Pro registers its placements here.
     */
    apply_filters( 'adflow_placement_types', $types );
  • includes/class-simple-google-adsense-admin.php line 164
    /**
     * Filters the AdFlow Pro URL (e.g. for affiliate links).
     */
    apply_filters( 'adflow_pro_url', $url, $campaign );
  • includes/class-simple-google-adsense-ad-units.php line 1237
    /**
     * Fires when AdFlow asks page caches to purge.
     */
    do_action( 'adflow_purge_page_cache' );
  • includes/class-simple-google-adsense-manual-ads.php line 320
    /**
     * Renders an ad unit of a type added by an add-on.
     */
    apply_filters( 'adflow_render_ad_type', '', $unit, $context );
  • includes/class-simple-google-adsense-reports.php line 258
    /**
     * Fires at the right of the report filter bar (Pro: CSV export).
     */
    do_action( 'adflow_reports_actions', $args );
  • includes/class-simple-google-adsense-reports.php line 367
    /**
     * Fires in each ad row (Pro: revenue / eCPM).
     */
    do_action( 'adflow_reports_ad_columns', $unit, $row, $args );
  • includes/class-simple-google-adsense-reports.php line 382
    /**
     * Fires below the report (Pro: placements, advertisers, devices).
     */
    do_action( 'adflow_reports_after', $args );
  • includes/class-simple-google-adsense-reports.php line 118
    /**
     * Filters the report arguments (Pro: custom date ranges).
     */
    apply_filters( 'adflow_reports_args', $args );
  • includes/class-simple-google-adsense-reports.php line 234
    /**
     * Fires inside the report filter bar (Pro: custom dates).
     */
    do_action( 'adflow_reports_filters', $args );
  • includes/class-simple-google-adsense-caps.php line 104
    /**
     * Filters who is told about ads waiting for review.
     */
    apply_filters( 'adflow_review_recipients', $emails, $post );
  • includes/class-simple-google-adsense-ad-units.php line 1093
    /**
     * Filters the ad unit data before it is saved.
     */
    apply_filters( 'adflow_sanitize_ad_unit', $data, $input, $post_id );
  • includes/class-simple-google-adsense-admin.php line 654
    /**
     * Filters the sanitized core settings.
     */
    apply_filters( 'adflow_sanitize_settings', $sanitized_input, $input );
  • includes/class-simple-google-adsense-admin.php line 678
    /**
     * Filters the Settings tabs.
     */
    apply_filters( 'adflow_settings_tabs', array() );
  • includes/class-simple-google-adsense-dashboard.php line 91
    /**
     * Filters the Dashboard setup steps.
     */
    apply_filters( 'adflow_setup_steps', $steps );
  • includes/class-simple-google-adsense-placements.php line 202
    /**
     * Filters the extra placement keys statistics may be stored under.
     */
    apply_filters( 'adflow_stats_placement_keys', array(), $key );
  • includes/class-simple-google-adsense-stats.php line 946
    /**
     * Filters the weighted events one client may send per minute (a click weighs
     * 5). Raise it behind a proxy not listed in adflow_trusted_proxies, where all
     * visitors share an address; 0 turns the limit off.
     */
    apply_filters( 'adflow_stats_rate_limit', self::RATE_LIMIT );
  • includes/class-simple-google-adsense-stats.php line 681
    /**
     * Filters whether beacons need the page's token. Turn off only for pages kept
     * for more than a year (a static export, for example).
     */
    apply_filters( 'adflow_stats_require_token', true );
  • includes/class-simple-google-adsense-stats.php line 810
    /**
     * Filters the proxies whose forwarding headers are believed.
     */
    apply_filters( 'adflow_trusted_proxies', self::cloudflare_ranges() );
  • includes/class-simple-google-adsense-ads-txt.php line 260 · used in 2 places
    apply_filters( 'https_local_ssl_verify', false );
  • includes/class-simple-google-adsense-settings.php line 322
    apply_filters( 'adflow_ad_label', isset($labels[$key]) ? $labels[$key] : '', $key );
  • includes/class-simple-google-adsense-stats.php line 503
    apply_filters( 'adflow_bot_pattern', '/(?<!cu)bot\b|bot\/|crawl|spider|slurp|mediapartners|adsbot|facebookexternalhit|embedly|quora link|outbrain|pinterest\/0\.|preview|fetch|monitoring|monitor\/|-monitor|site24x7|statuscake|uptime|pingdom|gtmetrix|lighthouse|pagespeed|headless|phantomjs|puppeteer|playwright|selenium|curl|wget|python|java\/|go-http|okhttp|axios|node-fetch|scrapy|httpclient|libwww|ahrefs|semrush|mj12|dotbot|petalbo... );
  • uninstall.php line 103
    apply_filters( 'adflow_delete_data_on_uninstall', is_array($settings) && !empty($settings['delete_data']) );
  • includes/class-simple-google-adsense-stats.php line 1371
    apply_filters( 'adflow_delete_stats_with_ad', true, $post_id );
  • includes/class-simple-google-adsense-inspector.php line 66
    apply_filters( 'adflow_inspector_enabled', true );
  • includes/class-simple-google-adsense-placements.php line 473
    apply_filters( 'adflow_paragraph_container_tags', array('blockquote', 'table', 'ul', 'ol', 'figure', 'pre', 'aside', 'details', 'nav', 'form', 'template', 'script', 'style') );
  • includes/class-simple-google-adsense-placements.php line 632
    apply_filters( 'adflow_placement_groups', array( 'content' => __('Inside posts & pages', 'simple-google-adsense'), 'archive' => __('Post lists & archives', 'simple-google-adsense'), 'site' => __('Site-wide', 'simple-google-adsense'), 'woocommerce' => __('WooCommerce', 'simple-google-adsense'), 'pro' => __('More placements with AdFlow Pro', 'simple-google-adsense'), ) );
  • includes/class-simple-google-adsense-upsell.php line 267
    apply_filters( 'adflow_pro_checkout_url', $url, $plan, $period, $campaign );
  • includes/class-simple-google-adsense-upsell.php line 142
    apply_filters( 'adflow_pro_features', array( 'earnings' => array( 'pillar' => 'see', 'icon' => 'chart-bar', 'title' => __('AdSense earnings in WordPress', 'simple-google-adsense'), 'benefit' => __('Today, yesterday, this month, page RPM and top-earning pages - without logging in to AdSense. Connecting needs your own free Google Cloud project, set up once.', 'simple-google-adsense'), ), 'ab' => array( 'pillar' => 'see', 'icon' => 'r... );
  • includes/class-simple-google-adsense-upsell.php line 97
    apply_filters( 'adflow_pro_plans', array( 'personal' => array( 'name' => __('Personal', 'simple-google-adsense'), 'price' => '$49', 'period' => __('/ year', 'simple-google-adsense'), 'sites' => __('1 website', 'simple-google-adsense'), 'highlight' => false, 'note' => __('For bloggers with one site', 'simple-google-adsense'), 'lifetime' => '$129', 'yearly_id' => 1, 'lifetime_id' => 4, ), 'plus' => array( 'name' => __('Plus', 'sim... );
  • includes/class-simple-google-adsense-reports.php line 332
    do_action( 'adflow_reports_ad_columns_head' );
  • includes/class-simple-google-adsense-reports.php line 83
    apply_filters( 'adflow_reports_ranges', array( '7' => __('Last 7 days', 'simple-google-adsense'), '30' => __('Last 30 days', 'simple-google-adsense'), ) );
  • includes/class-simple-google-adsense-upsell.php line 72
    apply_filters( 'adflow_show_pro_promotions', true );
  • includes/class-simple-google-adsense-stats.php line 724
    apply_filters( 'allowed_redirect_hosts', $own, $host );
  • includes/class-simple-google-adsense.php line 243
    do_action( 'before_simple_google_adsense_init' );
  • includes/class-simple-google-adsense-ad-units.php line 1230
    do_action( 'litespeed_purge_all' );
  • includes/admin/dashboard/class-mantrabrain-admin-dashboard.php line 123
    apply_filters( 'mantrabrain_show_dashboard_widgets', false );
  • includes/class-simple-google-adsense-manual-ads.php line 842
    apply_filters( 'script_loader_tag', Simple_Google_Adsense_Consent::deferred_script($src, $handle . '-js'), $handle, $src );
  • includes/class-simple-google-adsense.php line 250
    do_action( 'simple_google_adsense_init' );
  • includes/class-simple-google-adsense.php line 81
    do_action( 'simple_google_adsense_loaded' );
  • includes/class-simple-google-adsense.php line 299
    apply_filters( 'simple_google_adsense_template_path', 'simple-google-adsense/' );
  • includes/class-simple-google-adsense-widget.php line 58
    apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
  • includes/class-simple-google-adsense-conditions.php line 212
    apply_filters( 'wpml_active_languages', null, array('skip_missing' => 0) );
  • includes/class-simple-google-adsense-conditions.php line 241
    apply_filters( 'wpml_current_language', null );
  • includes/class-simple-google-adsense-conditions.php line 272
    apply_filters( 'wpml_object_id', $ad_id, Simple_Google_Adsense_Ad_Units::POST_TYPE, true );

Generated from AdFlow's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Done for you

Rather have it built for you?

Tell us what should change and we’ll write and test the code using these hooks.

Plugin customisation

from $149

New features or changed behaviour, without editing the plugin’s files.

  • Built as a companion plugin, so updates never wipe it
  • Exact quote before we start
  • Tested on staging, then deployed

Typical turnaround: 3–7 business days

Choose this

Not sure which fits? Describe what you need and we’ll suggest the simplest option.

Can't find the right hook?

We can build the customisation for you. Describe what you need: