Acest modul nu a fost testat cu ultimele 3 versiuni importante ale WordPress. S-ar putea să nu mai fie întreținut sau susținut și ar putea avea probleme de compatibilitate când este folosit cu versiuni recente ale WordPress.

Any Hostname


Any Hostname alters all WordPress-generated URLs according to the servers current hostname, so that they will always correspond to the actual hostname as entered by the user, as opposed to always using the URL specified in the WordPress options. The plugin is ideal for making a site available across multiple domains or running local development servers.

Probleme cunoscute

This plugin will not be able to alter the contents of constants such as WP_CONTENT_URL and WP_PLUGIN_URL as these are (quite naturally) defined before any plugins are loaded. Plugin developers should instead rely on either one of the plugins_url(), content_url() or get_option() functions, which will always return the filtered hostname. An example of this is the WPtouch plugin, in which case you can override WPtouch’s compat_get_wp_content_url function, as described by this Gist:

Any Hostname might also obscure the value of WordPress and Site URL settings on the Options » General settings page, due to the fact that these values are retrieved using the get_option() function. The values actually stored in WordPress’ database is in fact your site’s true URL. From 1.0b2 up the plugin will deactivate the host filters on this page, which might cause some page resources to load from the default URL (potentially being unreachable).

Any Hostname will not work on WordPress Network sites (WPMU) due to the fact that the pages in a network install stores its URLs explicitily in the database. Any ideas on how to circumvent this would be greatly appreciated.

Due to a bug in the WordPress Settings API ( the plugin settings are located on the Privacy page on WordPress versions below 3.5. From 3.5 and up the settings can be found on the Permalinks page.


Any Hostname has two filters, allowing you to programatically override the filtered hostname or the list of allowed hostnames. These are described below.


  • Arguments: $host (required)
  • Return value: $host (required)

Takes a host as argument, and returns a host that will be used when substituting the domain in URLs supplied by WordPress. This filter can be used to make the plugin use a specific host under certain circumstances.


  • Arguments: $hosts (required)
  • Return value: $hosts (required)

Takes an array of allowed hosts as argument, and returns an array of hosts to be used when checking if the user specified host should be allowed. Hosts should be treated as regular expression patterns.


Capturi ecran

  • Any Hostname settings


Această secțiune descrie cum să instalezi modulul și să-l faci să lucreze.

  1. Upload the any-hostname directory to the /wp-content/plugins/ directory
  2. Activează modulul în meniul „Module” din WordPress
  3. Optionally edit the list of allowed hosts under ‘Options’ » ‘General’ (Privacy for WordPress versions below 3.5)


3 septembrie 2016
Thank you for this plugin! It has saved me a lot of time Greetings from Berlin 🙂
Citește toate cele 2 recenzii

Contributori și dezvoltatori

„Any Hostname” este un software open-source. La acest modul au contribuit următoarele persoane.


Tradu „Any Hostname” în limba ta.

Te interesează dezvoltarea?

Răsfoiește codul, vezi depozitarul SVN, sau abonează-te la jurnalul de dezvoltare prin RSS.

Istoric modificări


  • Added a setting for overriding the WordPress filter priority used for registering the URL overrides. Defaults to 20, but can be any value accepted by the add_filter()/remove_filter() functions. This can be helpful to solve priority conflicts with other plugins.


  • Added filter to the option option_theme_mods_{$current_theme_slug} to filter the URL to header image and background image when using for example get_header_image() or get_theme_mods() (Thanks to feedmeastraycat).
  • Added Ukranian localization (Thanks to Michael Yunat)


  • Due to a WordPress bug plugin settings have been moved to Settings / General.


  • Settings are now located under Settings / Permalinks on WordPress 3.5 or higher, as the Privacy page has been removed.
  • Bugfix for servers using HTTPS on redirected domains
  • Added slovak localization by Branco Radenovich of


  • Minor bugfixes and localization adjustments


  • Plugin is now using plugins_url() instead of its own filter in order to get the correct path for its javascript.
  • Added filters for plugins_url, content_url and upload_dir.
  • Fixed an issue with the URL filter for URLs that have a port number


  • Added localization support and Swedish localization.


  • Added host name caching, preventing a host from being evaluated against the regular expression patterns more than once per page load.
  • The plugin will nog disable host filters on the Options » General page in order to avoid obscuring the Site URL (home) and WordPress URL (siteurl) settings, potentially resulting in involuntary changing the sites default host name
  • The settings page will now display a warning when the list of allowed hosts does not include the current host.
  • Bug fix: Javascript needed used by the plugin on the admin pages will now also load from the filtered URL instead of WP_PLUGIN_URL


  • Versiunea inițială