In a previous post, I talked about Pinterest, a web page and image sharing website.In that post, I showed you the following code snippet that you would add between the ““ tags to stop the pinning of your images.

 <meta name="pinterest" content="nopin" />

Custom WordPress Function

That’s all fine and dandy, but if you use WordPress, you may want a function to add the code snippet automatically to the head of your WordPress site, so you don’t have to modify the theme yourself.

To block Pinterest images pinning, add the following code snippet to your theme’s functions.php file and you’ll accomplish this:

// Block Pinterest From Pinning Your Images 
function no_images_pinning() { echo '<meta name="pinterest" content="nopin" />'; } add_action( 'wp_head', 'no_images_pinning' );

You’re done! It’s that simple.