Dynamic hyperlinks

Dynamic hyperlinks is a feature that allows plugin users to add hyperlinks to tables and views. A dynamic hyperlink is generated on the fly. Column variables can be added to a hyperlink and are substituted on generation.


To add a dynamic hyperlink to a table or view:

  • Start the Data Explorer
  • Click on the Manage link of the table or view to which you want to add the hyperlink
  • Click on Dynamic Hyperlinks
  • Add your hyperlink(s)
  • Save your hyperlink(s)

See example below (click to enlarge)

  • The plugin allows to add multiple hyperlinks to a table
  • The links are added to the end of the table or view in the Data Explorer
  • The links are added to the end of the table or view in a Data Project (this will be changed later)
  • The Data Publisher allows you to put hyperlinks on any position

Hyperlink Settings

Hyperlink Label

Column label in a list or on a form.


Enable if hyperlink should be shown in lists.


Enable if hyperlink should be shown in forms.


Enable if hyperlink should be opened in a new tab or window.


Add a URL(like https://your-domain/) or add your own HTML including one or more hyperlinks. If you just add a URL, the plugin will use the Hyperlink Label and +Windows? settings. Otherwise the plugin uses your HTML code.

Add your own HTML if you want to:

  • add multiple hyperlinks in one column
  • use icons in your hyperlinks instead of the label text
  • your own HTML to this column

Column Value Substitution

To use column values in a hyperlink simply add the column name between $$ to your URL or HTML. In the example below the variable $$id$$ is substituted with the value for column id. Column id must be a column of the table for which the hyperlink is created.


Data Publisher Example

To add a hyperlink to a publication:

  • Edit the publication
  • Click on button “Select”
  • Add your columns and hyperlinks to the list on the right side
  • Save your publication

The example below (click to enlarge) uses HTML to show multiple hyperlinks in one column as icons.

Peter Schulz is a lecturer in information technology at the HAN university of applied sciences. He is an experienced programmer with more than 25 years experience in Oracle databases and tools. Peter is the developer of WordPress plugin WP Data Access.

14 Replies to “Dynamic hyperlinks”

  1. Hi Peter,

    so my suggestion is: If I use a Dynamic Hyperlink and use a link like: and I want to add the column information from “my_id” then my link is: “$$my_id$$” correct?

    Next I want to use the my_id information in a shortcode from a datapublisher-page to filter the table entries there. Is that even possible?
    If not, how can I use the Dynamic-Link-Information to get data from a table and display that on a custom wordpress page or post?

    Thank you so much! I have the impression that I’m missing some connections in how these value substitutions work..

    Have a nice day,

  2. Hi Chiara,

    Your suggestion is correct! That’s is exactly how dynamic hyperlinks (value substitutions) are meant to be use. πŸ˜‰

    It should be possible to use argument my_id in your publication as well, but I haven’t tested it. Please check out this options to define an initial search on a specific column:

    Within the plugin you can use filter wpda_wpdataaccess_prepare to read the url argument and write its value to a javascript variables, which can then be used in your initial search. Here is some information about filter wpda_wpdataaccess_prepare:

    In your use case you might also want to disable a global search. You can use the dom option to do this:

    Looks like you’re building a complete application with a flow from data entry until data publication? Great! πŸ™‚ Let me know if you help…

    Best wishes,

    1. Good Morning Peter,

      yesterday I’ve tried to understand, how this could work out, but I didn’t made much progress.

      First question: where do I have to edit the filter wpdata_wpdataaccess? Is the filter integrated in the plugin-files somewhere or can I use it directly in the plugin-frontend on wordpress somehow?

      Second question: when I did the dynamic hyperlink with “$$my_id$$” and then click on this in a row of my published table the link I get is: “$$my_id$$”. There is no value substitution happening. Do I have to add more information to the dynamic link or what is going wrong here? Is there a problem because my “test-page” is a wordpress page and has no extension “.php”?

      Thrid question: how can I then connect the filter wpdata_wpdataaccess_prepare with my publication?

      I would be so glad, if you could do a short tutorial or something to this issue. Something like “how can I add a dynamic link to a publicated table, which links to a page, where I filter data from a table and show only a picture or the price of the product and not all detail-information?”
      If you don’t have the time to do a tutorial, i totally understand that.

      Thank you sooo much for your support! Don’t know, what I would do without your constant, helpful support!


      1. Hi Chiara,

        Let’s start with the dynamic hyperlink. Does your table have a column my_id? The plugin will only substitute values for existing column names. If your table has no column my_id, nothing happens. Make sure your are writing an existing column name between the $$ characters. For example: use $$student_id$$ to add the student_id to your hyperlink.

        When your hyperlink points to:
        you need to make sure this page exists and is able to handle argument my_id. Your hyperlink can be on the same domain or another domain. So:
        works as well. Your hyperlink URL does not need to have an extension .php as long as the URL is able to handle the querystring (in this case my_id=123) you are sending.

        Be carefull with the filter! The name of the filter is:
        wpda_wpdataaccess_prepare (not: wpdata_wpdataaccess_prepare)

        To add a filter, you need to put your PHP code “somewhere”. There are severals ways to do this. One of the most common ways I think is to add your code to the theme function.php file. The disadvantage is that a theme update overwrites your changes.

        I created a plugin add-on – the Code Manager – to add your own hooks and filters in such a way that it survives all types of updates (WordPress, themes and plugins). The add-on is ready, but I do not yet have a sales channel (working on it). I will need to create an instruction video for this add-on anyway, so I’ll try to create a video this week. I hope the video will help you to write your own hooks and filters.

        Best regards,

  3. Hi Peter,

    In the example on top of this page, on the ‘Settings’ tab, an option ‘Search Settings’ is visible, which is not on my version (3.1.4) of the WP Data Access plugin.

    What I’m looking for is an example how to create an advanced search form with multiple fields. The user’s input could than be processed by a PHP-script on the server and a temporary results table could than be handled by the Data Publisher.

    However, I didn’t find out how to create search fields on a form with your plugin thus far.
    Would you be so kind to provide an example?

    Thanks in advance,
    Ike de Pagter

    1. Hi Iek,

      Sharp eyes! πŸ™‚ I think I forgot to disable that option when I created that screenshot.

      The premium version of the plugin, coming out this month, allows to add a number of search option. The premium version is not free! If you are interested, here is a link to a video in which some of the premium search features are explained: https://www.youtube.com/watch?v=Zy_AWrULgCI

      Best regards,

  4. Hi Peter,

    Question for you about the use “Column Value Substitution” in the context of Dynamic hyperlinks.

    The table column I’m using as the source for the substitution contains a UK post code e.g. TN21 567 (note the space character). The substitution process appears to be truncating the content immediately after the space i.e. TN21 is being returned and the 567 is ignored. Is this a feature or something I’m doing my side?

    Thanks and regards.


    Founder of AircraftTrafficSurvey.com

    1. Hi Richard,

      The truncation is not related to the value substitution. If the value does not fit the browser wraps it. You can prevent wrapping with CSS. For your postcode column this could be:

      table.dataTable td.postcode {
      white-space: nowrap;

      Can you send me the URL if this does not work?


  5. Hi Peter,

    The following URL demonstrates the problem http://www.aircrafttrafficsurvey.com/?page_id=1303

    You will see two images of aircraft which are the hyperlinks. The first one passes the value for the Location (working) the second passes the postcode (failing i.e. gets truncated) but as you will see the postcode appears okay on the page.

    The hypertext links are as follows;



    Hope this demonstrates the issue.

    Thanks and regards.

    Founder of AircraftTrafficSurvey.com

    1. Hi Richard,

      Thanks for your explanation! This is a completely different issue…

      Some characters in URL arguments need to be encode. A blank needs to be substituted with +

      “WV7+3JD” instead of “WV7 3JD”

      If your dynamic hyperlink html column contains a URL only, I can let the plugin do the substitution. If you are using a more complex format, you can use a view. So what do your hyperlinks look like?


  6. Hi Peter, I’ve included a new column into the table that contained the replaced space with a + for the Postcode attribute. It now works as expected. If I had tried to do the substitution using JavaScript where could I have done this? Using the Publisher Table Advanced Options or somewhere else?

    Thanks and Regards.


    1. Hi Richard,

      Good question! πŸ™‚ With javascript I would suggest to use a function and do the encoding in the javascript function. You can call the javascript function from your dynamic hyperlink.

      If you are looking for a tool to add javascript functions to your page, you might want to have a look at my new plugin the Code Manager:

      Using javascript functions is documented here:

      Just in case you want to use javascript in your dynamic hyperslinks… πŸ™‚

      Best regards,

    1. Thank you Lucas! πŸ™‚ I changed it right away. You’ll find your contribution in the next release.

      Best regards,

Leave a Reply

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

4 × three =