These are the constants that are used or can be used with Advanced Ads. Most of these constants can just be defined in your site’s wp-config.php file with a single line like this:
define( 'ADVANCED_ADS_PRO_REFERRER_EXDAYS', 0 );
If one of the following Advanced Ads constants is enabled on your website, you will see the notice
Advanced Ads related constants enabled_ in your backend.
Table of Contents
You can set the
ADVADS_ADS_DISABLED constant to disable all ads at a certain point when building the frontend output of your website.
Advanced Ads also set’s this constant when options like Disable all ads in the frontend are selected in the plugin settings.
There is no need to set it to
Sample code you can use to set the constant: (always test if it already exists!)
Set this constant in your wp-config.php file in order to allow AdSense ads to appear on 404 error pages.
Basic plugin path.
Basic plugin URL.
Included in Advanced Ads Pro.
Length of the content when ad injection is used.
Set this constant if you don’t want to create responsive images for image ads and images in rich content ads as introduced in WordPress 4.4.
Since WordPress 5.5, this constant also disables lazy loading of images in the ad content. This relates to the WordPress-native lazy loading technology, not Lazy Loading in Advanced Ads Pro.
Slug and textdomain used in many places to identify the plugin.
Define this constant with any value and only ad admin users will see the ad debug output.
Set this contant if you don’t want anonymizeIp enabled by default with Analytics tracking features.
Set this constant in order to prevent overriding attributes in the theme PHP functions or shortcodes to work.
Set this constant to disable code highlighting in the plain text ad type.
Set to disable the frontend edit button. When defined, the edit button will not show for logged-in users. The value is not important.
Removed in Advanced Ads 1.30.0. We found an automatic solution for the issue.
Set this constant in order to disable ad group weight updates in the frontend. Only on very high traffic sites, it can happen that the ad weights get overridden through a frontend call while an admin saves them in the admin area, so the old value is restored and the update has no effect.
Remove the shortcode icon from the TinyMCE interface for all users.
Set this constant to remove the option to use and execute PHP within ad code.
Set this constant in order to allow revisions for ads (only ad content).
Log requests to Google AdSense API in wp-content/advanced-ads-google-api-requests.log .
Allow applying content injection to a custom filter.
See an example here.
Set this constant in order to allow the injection of ads into hidden elements. Especially meant for the Custom Position placement.
Set the cookie duration of the page impressions visitor condition in Advanced Ads Pro in days. Default: 3650 days (10 years).
The following example would change the default cookie duration to 365 days (1 year).
Set the cookie duration of the URL referrer visitor condition in Advanced Ads Pro in days. Default: 365 days.
Set the cookie duration of the visitor profile cookie in seconds. Default 2592000 seconds (30 days).
true disables the browser width visitor condition in the Responsive add-on.
Relates to Selling Ads.
Set this constant to show the ad setup form after the content when a specific page is selected instead of in front of it.
Set this constant to show license debug information in Advanced Ads > Settings > Licenses when trying to enable or disable a license. It will prevent the license activation to work, so remove it if no longer needed.
Don’t show critical plugin errors in WordPress Admin.
Define this constant in order to activate a tracking debug log. Find more details under Debug tracking here.
true to enable Tracking ads with Google Analytics and another tracking method at the same time as described here.
This constant needs to be set if your web server prevents the default Frontend tracking method from working. See this section for more details.
Set this constant to avoid spreading impressions and clicks over a given period when an impression or click limit and expiry date is set.
Don’t generate a public stats page per ad.
Don’t track any activity from logged-in users. Needs to be