What methods exist to implement data values from external database into a Wordpress text page? I think that there are two possible ways but maybe there are some more ways to realize this?

  • Maybe there exists a WordPress Plugin? - I've tried to find one, but without luck. I don't know the keywords how to find one. The https://de.wordpress.org/plugins/php-code-widget/ PHP code widget allows using PHP Code but only in Widgets, not in text.
  • Second idea to integrate data values into WordPress page is to use iframes. Not sure, if this is a good and practical idea.

I have made a sketch to better illustrate what I want to realize: Data from external Database

May you know some different ways to realize this?


You should write a plugin, or compact the code needed for this in a child theme functions.php. About pulling data from external databases: the simplest way is to use php built-in functions. I would proceed this way:

  1. Register a shortcode to place your table wherever you want in Wordpress, you probably want to pass some values, to select the specific data you want to pull from the database or the look the table should have
  2. Hook the shortcode to a function, that connects to the external db and queries it, according to your needs, builds a table using the data and outputs it.

Resources: Wordpress Shortcodes, Html table output via php

  • Thank you for your clear explanation and the resources. - After first reading, I thought it would be very complicated. But I found some further reading with "functions" and "shortcode" and I just realized a first SELECT output. That was easier than expected. Thanks. – Peter Mar 9 '18 at 10:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.