Questo plugin non è stato testato con le ultime 3 versioni principali (major releases) di WordPress. Potrebbe non essere più mantenuto, o supportato, e potrebbe presentare problemi di compatibilità se utilizzato con versioni più recenti di WordPress.

Domain Name Autoswitch


Here is a useful method you should use any where you need it dnas_get_post_ID().

It returns the post ID (if any) related to the current domain name.
For instance, if you would like to display URL of the fake home page:

You can check the plugin development on github.


  • since the plugin does not modify nor use your .htaccess file,
    it works with every permalink formats.
  • allow you to manage your domain names directly through your
    post edit forms.


  • since it hacks the query variables, some template tags like is_home()
    could not work as expected if a dedicated domain name is triggered.
  • be aware there is no conflict support: you can fill the same domain
    for several posts. Only a single one will win the game, without
    any control from your part (but it will be easy to see which one have
    to be checked… if you ever notice it). Be careful!


The plugin works with both custom post types and classic post type.
You have to edit a configuration file in order to indicate on which
posts the plugin should add its domain name field. You can indicate
Categorie identifiers or/and Post Types slugs. For instance, to make
the plugin showing its domain field on any posts of the categories #4
and #8, then:

$dnas_categories_ID = array( 4, 8 );


The Advanced Custom Fields
plugin is required.


This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2
as published by Sam Hocevar. See ( for more details.


  1. First, unzip or upload the plugin into /wp-content/plugins/.
  2. In the plugin directory, edit the following file:
  3. Then, rename the config file to: domain-name-autoswitch-config.php.
  4. Activate the plugin through the WordPress Plugins admin page.
  5. Set up your domain names like you want to, directly through the
    posts’ edit pages.
  6. Obviously, you will have to set up your virtual hosts (ServerAlias
    directives), so every domain names you want to use are pointing to
    your WordPress instance.


Non ci sono recensioni per questo plugin.

Contributi e sviluppo

“Domain Name Autoswitch” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.


Traduci “Domain Name Autoswitch” nella tua lingua.

Ti interessa lo sviluppo?

Esplora il Codice segui il Repository SVN iscriviti al Log delle Modifiche. Puoi farlo tramite RSS con un lettore di feed.

Changelog (registro delle modifiche)


  • Fix the way settings are saved: from now, settings are not erased after upgrading the plugin.


  • Fix SQL syntax when using custom post type identifiers.
  • Add license details.


  • Add the dnas_get_post_ID() global function.
  • Enhance the readme.txt.


  • Add the get_post_ID() method to the class.
  • Fix an issue with permalink: now hooks the permalinks values.
    For instance, the canonical meta link now displays the dedicated domain name.
  • Fix a singleton issue (public constructor).


  • First stable release.
  • Handle posts by categories or by post types.