diff --git a/.travis/pushdoc b/.travis/pushdoc
index e6727690f5008137fd65c6d9329be01c96fb13a1..c871389e5ed0aace3050a0cf1a9bfae3b1dae405 100755
--- a/.travis/pushdoc
+++ b/.travis/pushdoc
@@ -4,8 +4,7 @@ set -e
 set -x
 
 if [[ "$TRAVIS_BRANCH" =~ ^v2\.[0-9]+$ ]] ; then
-# TODO: this should be made automatic by reading the CHANGES/*.txt files:
-  if [ "$TRAVIS_BRANCH" = v2.0 ] || [ "$TRAVIS_BRANCH" = v2.1 ] || [ "$TRAVIS_BRANCH" = v2.2 ] ; then
+  if test -f CHANGES/"$TRAVIS_BRANCH".txt && grep -q plumednotmaintained CHANGES/"$TRAVIS_BRANCH".txt ; then
     branchtype=unsupported
   else
     branchtype=official
diff --git a/CHANGES/v2.0.txt b/CHANGES/v2.0.txt
index 659a47c2109e5f984b7db56f994e658e8e82265e..84ea874d764c6390da0b01747eaf68ce572d74cb 100644
--- a/CHANGES/v2.0.txt
+++ b/CHANGES/v2.0.txt
@@ -142,8 +142,7 @@ For developers:
 Version 2.0.5 (Dec 15, 2014)
 ----------------------------------------------
 
-Notice that branch 2.0 will not be longer maintained!
-All users are invited to switch to version 2.1.
+\plumednotmaintained
 
 For users:
 - Fixed a bug in replica exchange with different Hamiltonians (either lamdba-dynamics
diff --git a/CHANGES/v2.1.txt b/CHANGES/v2.1.txt
index 320e3745f6745632e1bbdef8b0c67d6357445898..b9ea5181c6acf37b850d52c30c5744a3f7796790 100644
--- a/CHANGES/v2.1.txt
+++ b/CHANGES/v2.1.txt
@@ -243,8 +243,8 @@ For users:
 
 Version 2.1.5 (Jan 18, 2016)
 ---------------------------------------------
-Notice that branch 2.1 will not be longer maintained!
-All users are invited to switch to version 2.2.
+
+\plumednotmaintained
 
 For users:
 - PLUMED now reports an error when using \ref HISTOGRAM with FREE-ENERGY without USE_ALL_DATA. See \issue{175}
diff --git a/CHANGES/v2.2.txt b/CHANGES/v2.2.txt
index 5009958451bfc1d9cf8c4ac9488bac27aa193f5e..721bb3c86053e662d79d898ee863afcdae01c759 100644
--- a/CHANGES/v2.2.txt
+++ b/CHANGES/v2.2.txt
@@ -185,7 +185,7 @@ For developers:
 Version 2.2.5 (Mar 31, 2017)
 -------------
 
-Notice that branch 2.2 will not be longer maintained! All users are invited to switch to version 2.3.
+\plumednotmaintained
 
 For users:
 - Fixed a problem with large step numbers in driver (see \issue{209}).
diff --git a/user-doc/Doxyfile b/user-doc/Doxyfile
index fdcd5c47715b2c7abb02b77fc52a7797d9d77f5a..dbb2887b41e853fa5a5680818271abd9a5b37ed3 100644
--- a/user-doc/Doxyfile
+++ b/user-doc/Doxyfile
@@ -232,7 +232,8 @@ ALIASES                = "hidden=\htmlonly <details> <summary> <b> To learn more
                          "hidden{1}=\htmlonly <details> <summary> <b> To learn more: \1 </b> </summary> <div class=\"hidden\"> \endhtmlonly" \
                          "endhidden=\htmlonly </div> </details> \endhtmlonly" \
                          "issue{1}=<a href=\"http://github.com/plumed/plumed2/issues/\1\">#\1</a>" \
-                         "branch{1}=<a href=\"http://github.com/plumed/plumed2/commits/\1\">\1</a>"
+                         "branch{1}=<a href=\"http://github.com/plumed/plumed2/commits/\1\">\1</a>" \
+                         "plumednotmaintained=\warning This branch is not maintained. Users are invited to upgrade to a newest version"
 
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
 # A mapping has the form "name=value". For example adding "class=itcl::class"