Keyword Substitution for Directlink

The main focus of this guide is to explain automatic keyword substitution for Directlink, using WordPress CMS as an example. For different CMS, you’ll need to find your own method of linking keyword substitution.

The URL parameter &q={QUERY} is essential because it can improve the website’s conversion rate. Normally, publishers replace {QUERY} with the page title either manually or automatically, depending on the website.

By setting up keyword substitution, you can automatically substitute the user parameter q with a relevant keyword. This will help provide a more comprehensive description of the content on the page and improve conversion rates. Now we make use of the page title since it gives a detailed overview of the content on the page.

If you can’t substitute a value in the user parameter &q dynamically, you should write a keyword that gives an overview of traffic: &q=examplekeyword.

Note that there’s an easier way to do this. You can install our WordPress Plugin for Download sites, which will handle keyword substitution for you.

To set up a shortcode for substituting the page title in the user parameter q, it is necessary to use a child theme on your website. If you don’t have one, you can create it using a plugin called Child Theme Configurator. In our case, we will create a child theme because we don’t have one.

Simply go to the Tools section and select Child Themes.

Select the option Create a new Child Theme by ticking the box and choose the theme you are currently using. After that, click on the Analyze button.

Scroll down to the bottom of the page. Finally, click on the Create New Child Theme button.

After creating the child theme, make sure it is set as active in the Appearance – Themes section of WordPress.

Be aware that changing your website’s WordPress theme may cause unintended consequences, so it’s important to exercise caution.

When setting up your child theme, you can access the directory where WordPress is located using a file manager and find the file for the child theme, which is typically located at wp-content/themes/your-theme-child.

Then, open the file functions.php and add the following code at the end of the file.

function post_title_shortcode(){ return get_the_title(); } add_shortcode('post_title','post_title_shortcode'); 

Save the changes and make sure they are implemented successfully. You should see the shortcode [post_title] visible in the preview when you include it in a post.

Once the setup is complete and everything is functioning correctly, you can complement your directlink, which should now appear as follows:

http://example.com/r?token=4578a1e85b789c55185f97560d5980dfd5c68339&q=[post_title]

After going back to the WordPress Settings section, choose Ad Inserter.

Once there, locate the Block 1 and insert the shortcode for directlink that is used in the Download button. Once you have inserted the shortcode, the resulting display should look similar:

<a href="example.com/r?token=4578a1e85b789c55185f97560d5980dfd5c68339&q=[post_title]" target="_blank"><img src="https://i.ibb.co/3BN3yTx/Download-Button-PNG-Photo.png" alt="Download-Button" border="0" width="250"></a>

Finally, remember to click on Save Settings.

To verify if the keyword is being inserted into the link correctly, open any post on your site, right-click on the Download button, and select View Code. If successful, you should see a link with the page’s title in the sidebar:

http://example.com/r?token=4578a1e85b789c55185f97560d5980dfd5c68339&q=Hello%20world
Scroll to Top