Do they have to be htm files? If you are able to make them php files then include a file with a constant representing the text you want to display... Otherwise I'd create a php file with an array for each filename you need to edit. Read the file into a string. Replace the string and then save it back. Loop through the array and repeat the action for each file