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.
// 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
-
/** * Filters the final ad markup. */ apply_filters( 'adflow_ad_markup', $output, $unit, $context ); -
/** * This action is documented in render_unit(). */ do_action( 'adflow_ad_rendered', $unit, $context ); -
/** * Filters whether this particular ad is output. */ apply_filters( 'adflow_should_display_ad', true, $unit, $context ); -
/** * Filters the attributes of the wrapping `<div>`. */ apply_filters( 'adflow_ad_wrapper_attributes', $wrapper, $unit, $context ); -
/** * This action is documented in * Simple_Google_Adsense_Placements::render_page(). */ do_action( 'adflow_placement_options', $key, $slot, $name ); -
/** * This action is documented in * Simple_Google_Adsense_Placements::render_page(). */ do_action( 'adflow_placement_settings_fields', $key, $slot, $name ); -
/** * This filter is documented in Simple_Google_Adsense_Placements::sanitize(). */ apply_filters( 'adflow_sanitize_placement', $slot, $raw, $key ); -
/** * Fires after AdFlow access was changed (Pro: audit log). */ do_action( 'adflow_access_saved' ); -
/** * Filters the ad diagnostics (Pro adds targeting and caps). */ apply_filters( 'adflow_ad_diagnostics', $out, $unit ); -
/** * 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 ); -
/** * Filters the attributes of the `<ins class="adsbygoogle">` element. */ apply_filters( 'adflow_ad_ins_attributes', $ins, $unit, $context ); -
/** * 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)'... ); -
/** * Filters a loaded ad unit. Pro stores extra keys (e.g. reserved height). */ apply_filters( 'adflow_ad_unit', $data, $post ); -
/** * Fires at the end of the Delivery box. Pro adds advertiser details. */ do_action( 'adflow_ad_unit_delivery_fields', $data, $post ); -
/** * Fires after the core ad unit fields. Pro adds its fields here. */ do_action( 'adflow_ad_unit_fields', $data, $post ); -
/** * Fires in the "Use this ad unit" box for own ads. Pro adds the advertiser * report link. */ do_action( 'adflow_ad_unit_sidebar', $unit ); -
/** * Filters whether any AdFlow ad may be output on the current request. */ apply_filters( 'adflow_ads_allowed', $allowed ); -
/** * Filters the ads.txt body served by AdFlow. */ apply_filters( 'adflow_ads_txt_content', implode("\n", $lines) . "\n" ); -
/** * Filters whether a shortcode may override the site's ad client. */ apply_filters( 'adflow_allow_ad_client_override', $trusted, $ad_client, $post ); -
/** * Filters whether the Auto Ads snippet is printed on the current request. */ apply_filters( 'adflow_auto_ads_allowed', $allowed ); -
/** * Filters the address used for abuse limits. */ apply_filters( 'adflow_client_ip', $client, $remote ); -
/** * 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 ); -
/** * Filters the current language for placement rules. */ apply_filters( 'adflow_current_language', $language ); -
/** * Filters the Dashboard cards. Pro adds live earnings. */ apply_filters( 'adflow_dashboard_cards', $cards ); -
/** * Fires at the top of the Dashboard sidebar (upgrade card in the free * version). */ do_action( 'adflow_dashboard_sidebar' ); -
/** * Filters the Docs sections (add your own articles). */ apply_filters( 'adflow_docs_sections', $sections ); -
/** * 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']), ) ); -
/** * Filters the health checks. Pro adds its own. */ apply_filters( 'adflow_health_checks', $checks ); -
/** * Fires after ads were imported from another plugin. */ do_action( 'adflow_imported', $this->log ); -
/** * Filters the languages a placement can be limited to. */ apply_filters( 'adflow_languages', $languages ); -
/** * 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 ); -
/** * 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 ); -
/** * 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') ); -
/** * 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 ); -
/** * Filters whether a placement displays. Pro adds device, taxonomy, visitor and * referrer conditions here. */ apply_filters( 'adflow_placement_should_display', $display, $key, $placement ); -
/** * Filters the placement types. AdFlow Pro registers its placements here. */ apply_filters( 'adflow_placement_types', $types ); -
/** * Filters the AdFlow Pro URL (e.g. for affiliate links). */ apply_filters( 'adflow_pro_url', $url, $campaign ); -
/** * Fires when AdFlow asks page caches to purge. */ do_action( 'adflow_purge_page_cache' ); -
/** * Renders an ad unit of a type added by an add-on. */ apply_filters( 'adflow_render_ad_type', '', $unit, $context ); -
/** * Fires at the right of the report filter bar (Pro: CSV export). */ do_action( 'adflow_reports_actions', $args ); -
/** * Fires in each ad row (Pro: revenue / eCPM). */ do_action( 'adflow_reports_ad_columns', $unit, $row, $args ); -
/** * Fires below the report (Pro: placements, advertisers, devices). */ do_action( 'adflow_reports_after', $args ); -
/** * Filters the report arguments (Pro: custom date ranges). */ apply_filters( 'adflow_reports_args', $args ); -
/** * Fires inside the report filter bar (Pro: custom dates). */ do_action( 'adflow_reports_filters', $args ); -
/** * Filters who is told about ads waiting for review. */ apply_filters( 'adflow_review_recipients', $emails, $post ); -
/** * Filters the ad unit data before it is saved. */ apply_filters( 'adflow_sanitize_ad_unit', $data, $input, $post_id ); -
/** * Filters the sanitized core settings. */ apply_filters( 'adflow_sanitize_settings', $sanitized_input, $input ); -
/** * Filters the Settings tabs. */ apply_filters( 'adflow_settings_tabs', array() ); -
/** * Filters the Dashboard setup steps. */ apply_filters( 'adflow_setup_steps', $steps ); -
/** * Filters the extra placement keys statistics may be stored under. */ apply_filters( 'adflow_stats_placement_keys', array(), $key ); -
/** * 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 ); -
/** * 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 ); -
/** * Filters the proxies whose forwarding headers are believed. */ apply_filters( 'adflow_trusted_proxies', self::cloudflare_ranges() ); -
apply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'adflow_ad_label', isset($labels[$key]) ? $labels[$key] : '', $key ); -
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... ); -
apply_filters( 'adflow_delete_data_on_uninstall', is_array($settings) && !empty($settings['delete_data']) ); -
apply_filters( 'adflow_delete_stats_with_ad', true, $post_id ); -
apply_filters( 'adflow_inspector_enabled', true ); -
apply_filters( 'adflow_paragraph_container_tags', array('blockquote', 'table', 'ul', 'ol', 'figure', 'pre', 'aside', 'details', 'nav', 'form', 'template', 'script', 'style') ); -
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'), ) ); -
apply_filters( 'adflow_pro_checkout_url', $url, $plan, $period, $campaign ); -
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... ); -
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... ); -
do_action( 'adflow_reports_ad_columns_head' ); -
apply_filters( 'adflow_reports_ranges', array( '7' => __('Last 7 days', 'simple-google-adsense'), '30' => __('Last 30 days', 'simple-google-adsense'), ) ); -
apply_filters( 'adflow_show_pro_promotions', true ); -
apply_filters( 'allowed_redirect_hosts', $own, $host ); -
do_action( 'before_simple_google_adsense_init' ); -
do_action( 'litespeed_purge_all' ); -
apply_filters( 'mantrabrain_show_dashboard_widgets', false ); -
apply_filters( 'script_loader_tag', Simple_Google_Adsense_Consent::deferred_script($src, $handle . '-js'), $handle, $src ); -
do_action( 'simple_google_adsense_init' ); -
do_action( 'simple_google_adsense_loaded' ); -
apply_filters( 'simple_google_adsense_template_path', 'simple-google-adsense/' ); -
apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); -
apply_filters( 'wpml_active_languages', null, array('skip_missing' => 0) ); -
apply_filters( 'wpml_current_language', null ); -
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.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin 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 thisNot 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: