Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Please note, my intention here is not malicious. My intention is due to contractual issues between myself and a client that I am working to enforce.

Is there anything I can do - via PHP, .htaccess, MySQL or otherwise - that will ensure (to a decent extent) that a site would be difficult to migrate to a different host?

I completely understand that someone extremely well-versed in PHP, MySQL and WordPress might be able to find a workaround, but I need an easy solution that will ensure a client cannot zip up his WordPress app via FTP, export the database, and migrate it to a new host.

Restricting access to the MySQL admin and the root FTP is not an option.

Thanks for all your help!

share|improve this question
You explicitly state that things that do make sense to restrict (MySQL, FTP) cannot be denied. You can mess things up, but as long as client can make full dump it is trivial to hire another developer and undo your tweaks. So under these conditions I do not see a viable answer. – Rarst Jul 14 '11 at 11:13

closed as not a real question by toscho Apr 16 '12 at 1:01

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

I would use PHP to do this task. I would generate some PHP that generates a unique identifier based on the server the code is sat on. You could use the server MAC address to generate the unique identifier. If using the MAC address as your identifier if the current host moves the site to a different server or different network interface it will trigger a different ID. You could also use server IP address as the ID.

Now where to put that code. Well its pointless burying it in the WP core because as soon as you update WP the code would be overwritten. You could hide the code in the themes functions.php file but then the user could just switch theme and the code would be circumvented. The best place to put the code would be in what's called a Must Use Plugin. Thing is its easy to disable the code if the user knows its there. All they do is delete the file with the blocking code.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.