<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>画像コピー &#8211; WordPress Memo</title>
	<atom:link href="https://blog.riverforest-wp.info/tag/%E7%94%BB%E5%83%8F%E3%82%B3%E3%83%94%E3%83%BC/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.riverforest-wp.info</link>
	<description>WordPress に関する覚え書き</description>
	<lastBuildDate>Fri, 09 May 2025 12:48:52 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.riverforest-wp.info/wp-content/uploads/2018/05/cropped-icon-256x256-1-32x32.png</url>
	<title>画像コピー &#8211; WordPress Memo</title>
	<link>https://blog.riverforest-wp.info</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>コンテンツの複製を拒否するシンプルなコード</title>
		<link>https://blog.riverforest-wp.info/contents-no-copy/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Thu, 20 Apr 2023 04:47:57 +0000</pubDate>
				<category><![CDATA[Function]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[コンテンツコピー]]></category>
		<category><![CDATA[画像コピー]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3197</guid>

					<description><![CDATA[はじめに コンテンツの盗用による被害が結構な頻度で見受けられます。それに対応する一番シンプルな方法を以下に記します。以下の方法は、ブラウザや Javascript に少しでも知見のある方なら破れますが、無いよりは良いので [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>コンテンツの盗用による被害が結構な頻度で見受けられます。それに対応する一番シンプルな方法を以下に記します。以下の方法は、ブラウザや Javascript に少しでも知見のある方なら破れますが、無いよりは良いのではないかと思います。</p>



<h3 class="wp-block-heading">コード</h3>



<pre class="prism line-numbers"><code class="language-php language-html">/* スクリプトを読み込みます */
add_action(
	'wp_enqueue_scripts',
	function() {
		/* 管理画面以外で */
		if ( ! is_admin() ) {
			?>
			&lt;script>
			/* ブラウザの右クリックを無効にします */
			 document.oncontextmenu = function () { return false; }
			&lt;/script>
			&lt;style>
			/* タブレットやスマートフォンの長押しを無効にします */
			.nocopy {
			 -webkit-touch-callout: none;
			 -webkit-user-select: none;
			 -khtml-user-select: none;
			 -moz-user-select: none;
			 -ms-user-select: none;
			 user-select: none;
			}
			&lt;/style>
			&lt;?php
		}
	},
	10,
	1
);
/* 上記の 'nocopy' クラスを、body タグに追加します */
add_filter( 'body_class',
	function() {
		/* 管理画面以外で */
		if ( ! is_admin() ) {
			return array( 'nocopy' );
		}
	},
	10,
	1
);</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
