diff --git a/.gitignore b/.gitignore
index 45ccf3aef..dd8a33a22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -151,7 +151,7 @@ examples/F90/eccodes_f_grib_copy_message
examples/F90/eccodes_f_copy_namespace
examples/F90/eccodes_f_count_messages
examples/F90/eccodes_f_grib_get_keys
-examples/F90/eccodes_f_get_data
+examples/F90/eccodes_f_grib_get_data
examples/F90/eccodes_f_get_product_kind
examples/F90/eccodes_f_get_pl
examples/F90/eccodes_f_get_pv
diff --git a/doxygen/convert_links.sh b/doxygen/convert_links.sh
new file mode 100755
index 000000000..84469277f
--- /dev/null
+++ b/doxygen/convert_links.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+set -e
+
+# Change the links from example code back to confluence
+# This is only done the first time before checking in the new html files
+# Do not run this on html files which are already converted!
+fnames="
+ bufr_get_keys
+ grib_index
+ grib_get_keys
+ grib_set_keys
+ grib_get_data
+ grib_clone
+ grib_print_data
+ grib_copy_message
+ count_messages
+ grib_nearest
+ grib_samples
+ grib_set_missing
+"
+# Adding target="_blank" ensures link opens in a new tab/window in browser
+for fn in $fnames; do
+ perl -p -i -e "s|$fn\.f90|$fn.f90|" ../html/classeccodes.html
+ # Do all F90 interface files too
+ perl -p -i -e "s|$fn\.f90|$fn.f90|" ../html/interfaceeccodes*.html
+done
+
+pnames="
+ grib_get_keys
+ grib_set_keys
+ grib_samples
+ grib_set_missing
+ grib_nearest
+ grib_index
+ grib_print_data
+ grib_multi_write
+ grib_iterator
+ grib_clone
+ grib_keys_iterator
+ bufr_get_keys
+"
+for fn in $pnames; do
+ perl -p -i -e "s|$fn\.py|$fn.py|" ../html/namespaceec_codes.html
+done
+
diff --git a/doxygen/make_dox.sh b/doxygen/make_dox.sh
index 176d230a2..bc303078b 100755
--- a/doxygen/make_dox.sh
+++ b/doxygen/make_dox.sh
@@ -20,48 +20,9 @@ doxygen grib_api_wiz.cfg
# Do not copy this. Use default generated doxygen.css
# cp doxygen.css ../html/
+# ./convert_links.sh
+
# Remove temp files
rm -f eccodes.h
rm -f ecCodes.py
-
-# Change the links from any example code back to confluence
-fnames="
-bufr_get_keys
-grib_index
-grib_get_keys
-grib_set_keys
-grib_get_data
-grib_clone
-grib_print_data
-grib_copy_message
-count_messages
-grib_nearest
-grib_samples
-grib_set_missing
-"
-
-for fn in $fnames; do
- perl -p -i -e "s|$fn\.f90|$fn.f90|" ../html/classeccodes.html
- # Do all F90 interface files too
- perl -p -i -e "s|$fn\.f90|$fn.f90|" ../html/interfaceeccodes*.html
-done
-
-pnames="
-grib_get_keys
-grib_set_keys
-grib_samples
-grib_set_missing
-grib_nearest
-grib_index
-grib_print_data
-grib_multi_write
-grib_iterator
-grib_clone
-grib_keys_iterator
-bufr_get_keys
-"
-for fn in $pnames; do
- perl -p -i -e "s|$fn\.py|$fn.py|" ../html/namespaceec_codes.html
-done
-
echo DONE