Home / Attachments / Tasty Pins – Remove the Pin button for an image by URL
Duplicate Snippet

Embed Snippet on Your Site

Tasty Pins – Remove the Pin button for an image by URL

Easily exclude images from having this pin it button using the image url by javascript snippet:

<10
Code Preview
js
(function(callback) {
	if (document.readyState !== "loading") {
		callback();
	} else {
		document.addEventListener("DOMContentLoaded", callback);
	}
})(() => {
	let tp_exclusions = document.querySelectorAll('img[src="https://example.com/wp-content/uploads/2023/12/logo.png"]');
	if ( tp_exclusions.length === 0 ) {
		return;
	}
	for( const tp_exclusion of tp_exclusions ) {
		tp_exclusion.dataset.pinNopin = 'nopin';
	}
});

Comments

Add a Comment