Ads by Shortcode

Below, you’ll find a detailed guide on how to add the Ads by Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Ads by Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Ads by Plugin and the shortcodes it provides:

Plugin Icon
Ads by

"Ads by is a powerful WordPress plugin that integrates seamlessly with your site, allowing you to display targeted, relevant ads, boosting monetization and engagement."

★★★★✩ (32) Active Installs: 5000+ Tested with: 5.7.10 PHP Version: false
Included Shortcodes:
  • [dfads]

Ads by [dfads] Shortcode

The Datafeedr Ads shortcode is a powerful tool for displaying ads on your WordPress site. It uses the ‘dfads’ shortcode to call the ‘dfads_shortcode’ function. The ‘dfads_shortcode’ function returns ads based on the parameters specified in ‘atts’. This allows for dynamic ad display, enhancing site monetization.

Shortcode: [dfads]


Here is a list of all possible dfads shortcode parameters and attributes:

  • params – Parameters to modify the ad display

Examples and Usage

Basic example – The given shortcode is used to display ads by the Datafeedr Ads plugin. This is a simple usage where no parameters are specified.


Advanced examples

Displaying ads using specific parameters. In this case, the ‘params’ attribute is used to specify the parameters for the ads to be displayed. The parameters are passed as a string in the format: ‘param1=value1&param2=value2’.

[dfads params='limit=5&orderby=random']

Displaying ads using multiple parameters. This example uses the ‘params’ attribute to specify multiple parameters for the ads to be displayed. The parameters ‘limit’ and ‘orderby’ are used to limit the number of ads to 5 and order them randomly, respectively. The ‘categories’ parameter is used to display ads from specific categories.

[dfads params='limit=5&orderby=random&categories=10,15,20']

PHP Function Code

In case you have difficulties debugging what causing issues with [dfads] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'dfads', 'dfads_shortcode' );

Shortcode PHP function:

function dfads_shortcode( $atts ) {
	return dfads( $atts['params'] );

Code file location:



Now that you’ve learned how to embed the Ads by Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.


Leave a Reply

Your email address will not be published. Required fields are marked *