Server - Dynamic Shortcodes

Learn how to use the Server Dynamic Shortcode to access server information in WordPress.

Updated over a week ago

The Server Dynamic Shortcode in WordPress allows users to retrieve specific server information efficiently.

Syntax

{server:variable}
  • variable: The name of the server variable you wish to access, corresponding to the keys in the $_SERVER PHP global array.

Examples

  1. Accessing Server Name:

    {server:SERVER_NAME}

    This retrieves the server's domain name.

  2. Getting Server Software:

    {server:SERVER_SOFTWARE}

    Displays the server software being used (e.g., Apache, Nginx).

  3. Fetching Document Root:

    {server:DOCUMENT_ROOT}

    Returns the document root directory under which the current script is executing.

  4. Server Protocol:

    {server:SERVER_PROTOCOL}

    Shows the name and revision of the information protocol (e.g., HTTP/1.1).

  5. Remote Address:

    {server:REMOTE_ADDR}

    Retrieves the IP address from which the user is viewing the current page.

Special Privileges

The Server Dynamic Shortcode must be used within a Power Shortcode environment, which ensures that only authorized users with the appropriate permissions can access and use this shortcode.

Did this answer your question?