{"id":410,"date":"2026-08-15T22:08:23","date_gmt":"2026-08-15T13:08:23","guid":{"rendered":"https:\/\/wptoolslab.com\/query-lab\/?post_type=wpq_glossary&amp;p=410"},"modified":"2026-08-29T22:52:39","modified_gmt":"2026-08-29T13:52:39","slug":"compare","status":"publish","type":"wpq_glossary","link":"https:\/\/wptoolslab.com\/query-lab\/glossary\/compare\/","title":{"rendered":"compare"},"content":{"rendered":"<section class=\"conclusion wpq-conclusion\"><h2 class=\"wpq-conclusion__title\">\u307e\u305a\u7d50\u8ad6<\/h2><p>`compare` \u306f\u3001WP_Query \u306e `meta_query` \u306e\u4e2d\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u3069\u3046\u6bd4\u8f03\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3067\u3059\u3002\u5b8c\u5168\u4e00\u81f4\u306a\u3089 `=`\u3001\u4e00\u81f4\u3057\u306a\u3044\u3082\u306e\u306a\u3089 `!=`\u3001\u6570\u5024\u306e\u5927\u5c0f\u306a\u3089 `>` \u3084 `>=`\u3001\u90e8\u5206\u4e00\u81f4\u306a\u3089 `LIKE`\u3001\u5024\u306e\u5b58\u5728\u78ba\u8a8d\u306a\u3089 `EXISTS` \u306a\u3069\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<\/section>\n<p>`compare` \u306f\u3001\u5358\u72ec\u3067\u4f7f\u3046\u5f15\u6570\u3068\u3044\u3046\u3088\u308a\u3001`meta_query` \u306e\u6761\u4ef6\u914d\u5217\u306e\u4e2d\u3067\u4f7f\u3046\u6307\u5b9a\u3067\u3059\u3002`key` \u3067\u898b\u308b\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6c7a\u3081\u3001`value` \u3067\u6bd4\u8f03\u3059\u308b\u5024\u3092\u6c7a\u3081\u3001`compare` \u3067\u6bd4\u8f03\u65b9\u6cd5\u3092\u6c7a\u3081\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u300c\u4fa1\u683c\u304c3000\u5186\u4ee5\u4e0a\u306e\u5546\u54c1\u3092\u51fa\u3059\u300d\u306a\u3089\u3001`key` \u306f `price`\u3001`value` \u306f `3000`\u3001`compare` \u306f `&gt;=` \u306b\u306a\u308a\u307e\u3059\u3002\u6570\u5024\u3068\u3057\u3066\u6bd4\u8f03\u3059\u308b\u306a\u3089\u3001`type` \u3082\u5408\u308f\u305b\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"what-is-compare\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"lightbulb\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" \/>\n  <path d=\"M9 18h6\" \/>\n  <path d=\"M10 22h4\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">compare \u306f\u4f55\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u304b<\/span><\/h2>\n<p>`compare` \u306f\u3001`meta_query` \u306e\u4e2d\u3067\u5024\u306e\u6bd4\u8f03\u65b9\u6cd5\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3067\u3059\u3002\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u304c\u3001\u6307\u5b9a\u3057\u305f\u5024\u3068\u4e00\u81f4\u3059\u308b\u306e\u304b\u3001\u4e00\u81f4\u3057\u306a\u3044\u306e\u304b\u3001\u5927\u304d\u3044\u306e\u304b\u3001\u5c0f\u3055\u3044\u306e\u304b\u3001\u542b\u3080\u306e\u304b\u3001\u5b58\u5728\u3059\u308b\u306e\u304b\u3092\u6c7a\u3081\u307e\u3059\u3002<\/p>\n<p>`compare` \u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306b\u671f\u5f85\u3069\u304a\u308a\u52d5\u304f\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u521d\u5fc3\u8005\u5411\u3051\u306e\u30b3\u30fc\u30c9\u3067\u306f\u660e\u793a\u3057\u3066\u304a\u304f\u307b\u3046\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u6761\u4ef6\u306e\u610f\u56f3\u304c\u3001\u30b3\u30fc\u30c9\u3092\u898b\u305f\u4eba\u306b\u4f1d\u308f\u308a\u3084\u3059\u304f\u306a\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u5927\u4e8b\u306a\u306e\u306f\u3001`compare` \u306f\u300c\u6bd4\u8f03\u306e\u7a2e\u985e\u300d\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3060\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u3069\u306e\u30e1\u30bf\u30ad\u30fc\u3092\u898b\u308b\u304b\u306f `key`\u3001\u4f55\u3068\u6bd4\u3079\u308b\u304b\u306f `value`\u3001\u6570\u5024\u3084\u6587\u5b57\u5217\u3068\u3057\u3066\u3069\u3046\u6271\u3046\u304b\u306f `type` \u3067\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001`compare` \u3060\u3051\u3092\u898b\u3066\u3082\u6761\u4ef6\u5168\u4f53\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u3002`key`\u3001`value`\u3001`compare`\u3001`type` \u3092\u30bb\u30c3\u30c8\u3067\u8aad\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: compare \/ \u610f\u5473 \/ \u4f7f\u3046\u5834\u9762\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>compare<\/th><th>\u610f\u5473<\/th><th>\u4f7f\u3046\u5834\u9762<\/th><\/tr><\/thead><tbody><tr><td><code>=<\/code><\/td><td>\u6307\u5b9a\u5024\u3068\u4e00\u81f4\u3059\u308b<\/td><td>\u30d5\u30e9\u30b0\u304c <code>1<\/code>\u3001\u72b6\u614b\u304c <code>open<\/code> \u306a\u3069<\/td><\/tr><tr><td><code>!=<\/code><\/td><td>\u6307\u5b9a\u5024\u3068\u4e00\u81f4\u3057\u306a\u3044<\/td><td>\u7279\u5b9a\u306e\u5024\u4ee5\u5916\u3092\u53d6\u5f97\u3057\u305f\u3044\u6642<\/td><\/tr><tr><td><code>&gt;<\/code><\/td><td>\u6307\u5b9a\u5024\u3088\u308a\u5927\u304d\u3044<\/td><td>\u70b9\u6570\u304c80\u3088\u308a\u5927\u304d\u3044\u306a\u3069<\/td><\/tr><tr><td><code>&gt;=<\/code><\/td><td>\u6307\u5b9a\u5024\u4ee5\u4e0a<\/td><td>\u4fa1\u683c\u304c3000\u4ee5\u4e0a\u306a\u3069<\/td><\/tr><tr><td><code>&lt;<\/code><\/td><td>\u6307\u5b9a\u5024\u3088\u308a\u5c0f\u3055\u3044<\/td><td>\u70b9\u6570\u304c50\u672a\u6e80\u306a\u3069<\/td><\/tr><tr><td><code>&lt;=<\/code><\/td><td>\u6307\u5b9a\u5024\u4ee5\u4e0b<\/td><td>\u4fa1\u683c\u304c10000\u4ee5\u4e0b\u306a\u3069<\/td><\/tr><tr><td><code>LIKE<\/code><\/td><td>\u6307\u5b9a\u6587\u5b57\u5217\u3092\u542b\u3080<\/td><td>\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3067\u63a2\u3057\u305f\u3044\u6642<\/td><\/tr><tr><td><code>IN<\/code><\/td><td>\u6307\u5b9a\u5024\u306e\u3044\u305a\u308c\u304b\u306b\u4e00\u81f4\u3059\u308b<\/td><td>\u8907\u6570\u5019\u88dc\u306e\u3069\u308c\u304b\u306b\u5f53\u3066\u306f\u307e\u308b\u6642<\/td><\/tr><tr><td><code>NOT IN<\/code><\/td><td>\u6307\u5b9a\u5024\u306e\u3069\u308c\u306b\u3082\u4e00\u81f4\u3057\u306a\u3044<\/td><td>\u8907\u6570\u5019\u88dc\u3092\u9664\u5916\u3057\u305f\u3044\u6642<\/td><\/tr><tr><td><code>EXISTS<\/code><\/td><td>\u30e1\u30bf\u30ad\u30fc\u304c\u5b58\u5728\u3059\u308b<\/td><td>\u5024\u306e\u4e2d\u8eab\u3088\u308a\u5b58\u5728\u6709\u7121\u3092\u898b\u305f\u3044\u6642<\/td><\/tr><tr><td><code>NOT EXISTS<\/code><\/td><td>\u30e1\u30bf\u30ad\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044<\/td><td>\u672a\u8a2d\u5b9a\u306e\u6295\u7a3f\u3092\u63a2\u3057\u305f\u3044\u6642<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<h2 id=\"common-compares\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"refresh\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" \/>\n  <path d=\"M21 3v5h-5\" \/>\n  <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" \/>\n  <path d=\"M8 16H3v5\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u3088\u304f\u4f7f\u3046 compare \u306e\u4f7f\u3044\u5206\u3051<\/span><\/h2>\n<p>`compare` \u306f\u7a2e\u985e\u304c\u591a\u3044\u305f\u3081\u3001\u6700\u521d\u304b\u3089\u3059\u3079\u3066\u3092\u899a\u3048\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5b8c\u5168\u4e00\u81f4\u3001\u5927\u5c0f\u6bd4\u8f03\u3001\u90e8\u5206\u4e00\u81f4\u3001\u5b58\u5728\u78ba\u8a8d\u306e4\u7cfb\u7d71\u304b\u3089\u9078\u3076\u3068\u3001\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3092\u5224\u65ad\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5358\u7d14\u306a\u30d5\u30e9\u30b0\u3084\u30b9\u30c6\u30fc\u30bf\u30b9\u306a\u3089 `=`\u3001\u4fa1\u683c\u3084\u70b9\u6570\u306a\u3089 `&gt;=` \u3084 `&lt;=`\u3001\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u63a2\u3059\u306a\u3089 `LIKE`\u3001\u5024\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u3060\u3051\u898b\u305f\u3044\u306a\u3089 `EXISTS` \u304c\u5019\u88dc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>`LIKE` \u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u601d\u3063\u305f\u3088\u308a\u5e83\u304f\u4e00\u81f4\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4fdd\u5b58\u5024\u306e\u4e00\u90e8\u306b\u5076\u7136\u540c\u3058\u6587\u5b57\u5217\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3082\u4e00\u81f4\u3059\u308b\u305f\u3081\u3001\u4f7f\u3044\u3069\u3053\u308d\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>`IN` \u306f\u8907\u6570\u5019\u88dc\u306e\u3044\u305a\u308c\u304b\u306b\u4e00\u81f4\u3059\u308b\u6295\u7a3f\u3092\u63a2\u3059\u6642\u306b\u4fbf\u5229\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001`value` \u306f\u914d\u5217\u3067\u6307\u5b9a\u3059\u308b\u8003\u3048\u65b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"builder\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"builder\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m18 16 4-4-4-4\" \/>\n  <path d=\"m6 8-4 4 4 4\" \/>\n  <path d=\"m14.5 4-5 16\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">Builder \u3067\u306e\u6271\u3044<\/span><\/h2>\n<p>WP Query Builder \u3067\u306f\u3001`compare` \u306f `meta_query` \u306e\u6bd4\u8f03\u65b9\u6cd5\u3092\u9078\u3076\u9805\u76ee\u3067\u3059\u3002`&gt;=` \u3084 `LIKE` \u3060\u3051\u3067\u306a\u304f\u3001\u300c\u4ee5\u4e0a\u300d\u300c\u4ee5\u4e0b\u300d\u300c\u4e00\u81f4\u3059\u308b\u300d\u300c\u542b\u3080\u300d\u300c\u5b58\u5728\u3059\u308b\u300d\u3068\u3044\u3046\u65e5\u672c\u8a9e\u30e9\u30d9\u30eb\u3082\u6dfb\u3048\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070 Builder \u3067\u306f\u3001\u300c\u30e1\u30bf\u30ad\u30fc: price\u300d\u300c\u6bd4\u8f03: \u4ee5\u4e0a\u300d\u300c\u5024: 3000\u300d\u300c\u578b: \u6570\u5024\u300d\u306e\u3088\u3046\u306b\u5165\u529b\u3055\u305b\u3001\u5185\u90e8\u3067 `compare =&gt; &#8216;&gt;=&#8217;`\u3001`type =&gt; &#8216;NUMERIC&#8217;` \u306b\u5909\u63db\u3059\u308b\u5f62\u3067\u3059\u3002<\/p>\n<p>`EXISTS` \u3084 `NOT EXISTS` \u3092\u9078\u3093\u3060\u5834\u5408\u306f `value` \u5165\u529b\u3092\u96a0\u3057\u3001\u6570\u5024\u6bd4\u8f03\u306a\u3089 `type` \u3082\u7d9a\u3051\u3066\u9078\u3079\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u6bd4\u8f03\u65b9\u6cd5\u306b\u5408\u308f\u306a\u3044\u5165\u529b\u6b04\u3092\u6b8b\u3055\u306a\u3044\u8a2d\u8a08\u3067\u3059\u3002<\/p>\n<h2 id=\"practical-article\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"search\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m21 21-4.34-4.34\" \/>\n  <circle cx=\"11\" cy=\"11\" r=\"8\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u4f7f\u3044\u3069\u3053\u308d\u30fb\u907f\u3051\u3069\u3053\u308d\u3068\u5b9f\u8df5\u78ba\u8a8d<\/span><\/h2>\n<p>`meta_query` \u306e\u5024\u3092\u7b49\u4fa1\u4ee5\u5916\u306e\u65b9\u6cd5\u3067\u6bd4\u3079\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u671f\u5f85\u3059\u308b\u6bd4\u8f03\u898f\u5247\u3092\u8aac\u660e\u3067\u304d\u308b\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ad\u30fc\u306e\u5b58\u5728\u78ba\u8a8d\u3060\u3051\u3067\u8db3\u308a\u308b\u5834\u5408\u3084\u3001\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u306e\u30bf\u30fc\u30e0\u3092\u6bd4\u3079\u308b\u5834\u5408\u306f\u540c\u3058 `compare` \u3068\u8003\u3048\u307e\u305b\u3093\u3002<\/p>\n<p>\u6570\u5024\u3092\u6587\u5b57\u5217\u306e\u307e\u307e\u6bd4\u8f03\u3059\u308b\u3068\u5927\u5c0f\u95a2\u4fc2\u304c\u5d29\u308c\u308b\u305f\u3081\u3001\u5024\u306e\u4fdd\u5b58\u5f62\u5f0f\u3068 `type` \u3092\u30bb\u30c3\u30c8\u3067\u6c7a\u3081\u307e\u3059\u3002<\/p>\n<p>\u540c\u3058\u300c10\u4ee5\u4e0a\u300d\u3067\u3082\u6587\u5b57\u5217\u6bd4\u8f03\u3068\u6570\u5024\u6bd4\u8f03\u3067\u306f\u7d50\u679c\u304c\u5909\u308f\u308b\u305f\u3081\u3001\u6f14\u7b97\u5b50\u3088\u308a\u5148\u306b\u4fdd\u5b58\u5024\u306e\u578b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u5883\u754c\u306e\u524d\u5f8c\u3092\u542b\u3080\u30e1\u30bf\u5024\u30923\u4ef6\u4ee5\u4e0a\u7528\u610f\u3057\u3001\u671f\u5f85\u3059\u308b\u6295\u7a3fID\u3001\u5b9f\u969b\u306e\u6295\u7a3fID\u3001SQL\u3067\u3069\u306e\u578b\u3068\u3057\u3066\u6bd4\u8f03\u3055\u308c\u305f\u304b\u3092\u540c\u3058\u8a18\u9332\u306b\u6b8b\u3057\u307e\u3059\u3002<\/p>\n<a class=\"deep-link-card wpq-related-link wpq-related-link--internal\" href=\"https:\/\/wptoolslab.com\/query-lab\/articles\/meta-query-filtering\/\"><span class=\"article-thumb wpq-related-link__thumb\"><img decoding=\"async\" alt=\"WP_Query\u306emeta_query\u3068\u306f\uff1f\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u7d5e\u308a\u8fbc\u3080\u65b9\u6cd5 \u306e\u30b5\u30e0\u30cd\u30a4\u30eb\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/meta-query-filtering-card-2.png\" loading=\"lazy\" \/><\/span><div class=\"deep-link-copy wpq-related-link__copy\"><small>\u5b9f\u8df5\u8a18\u4e8b\u3067\u78ba\u8a8d<\/small><b>meta_query\u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u7d5e\u308a\u8fbc\u3080<\/b><p>`compare` \u3060\u3051\u3067\u306a\u304f `key`\u30fb`value`\u30fb`type` \u3092\u4e00\u3064\u306e\u6761\u4ef6\u3068\u3057\u3066\u7d44\u3080\u5b9f\u8df5\u4f8b\u3078\u9032\u3081\u307e\u3059\u3002<\/p><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080 \u2192<\/span><\/span><\/div><\/a>\n<h2 id=\"official-docs\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"book\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M12 5v16\" \/>\n  <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">WordPress\u306e\u4ed5\u69d8\u3067\u78ba\u8a8d\u3059\u308b\u30dd\u30a4\u30f3\u30c8<\/span><\/h2>\n<p>\u516c\u5f0f\u8cc7\u6599\u3067\u306f\u3001WP_Query \u306e Custom Field Parameters \u3068 WP_Meta_Query \u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3067\u3001`compare` \u306b\u6307\u5b9a\u3067\u304d\u308b\u5024\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002`key`\u3001`value`\u3001`type` \u3068\u5408\u308f\u305b\u3066\u78ba\u8a8d\u3059\u308b\u3068\u3001\u6761\u4ef6\u306e\u610f\u5473\u3092\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>`compare` \u306f\u6307\u5b9a\u5024\u306e\u7a2e\u985e\u304c\u591a\u3044\u305f\u3081\u3001\u8ff7\u3063\u305f\u6642\u306f\u516c\u5f0f\u8cc7\u6599\u306b\u623b\u3063\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002\u7279\u306b\u3001`EXISTS`\u3001`NOT EXISTS`\u3001`IN`\u3001`BETWEEN` \u306a\u3069\u3092\u4f7f\u3046\u5834\u5408\u306f\u3001`value` \u306e\u66f8\u304d\u65b9\u3082\u5408\u308f\u305b\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<section class=\"official-docs-card wpq-reference-card wpq-reference-card--official\"><div class=\"official-docs-head\"><span class=\"official-docs-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"book\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M12 5v16\" \/>\n  <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" \/>\n<\/svg><\/span><div><p class=\"eyebrow wpq-eyebrow\">\u516c\u5f0f\u30ea\u30f3\u30af<\/p><h2>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h2><\/div><\/div><ul class=\"wpq-reference-list\"><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Query Class<\/strong><span class=\"wpq-reference-item__description\">`meta_query` \u3068 Custom Field Parameters \u306e\u57fa\u672c\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_meta_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Meta_Query<\/strong><span class=\"wpq-reference-item__description\">`compare` \u306b\u6307\u5b9a\u3067\u304d\u308b\u5024\u3084\u3001\u30e1\u30bf\u6761\u4ef6\u306e\u69cb\u9020\u3092\u8a73\u3057\u304f\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><\/ul><\/section>\n<p>`compare` \u306f\u3001`meta_query` \u306e\u4e2d\u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u5024\u3092\u3069\u3046\u6bd4\u8f03\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3067\u3059\u3002\u5b8c\u5168\u4e00\u81f4\u3001\u5927\u5c0f\u6bd4\u8f03\u3001\u90e8\u5206\u4e00\u81f4\u3001\u8907\u6570\u5019\u88dc\u3001\u5b58\u5728\u78ba\u8a8d\u306a\u3069\u3001\u76ee\u7684\u306b\u5408\u308f\u305b\u3066\u9078\u3073\u307e\u3059\u3002<\/p>\n<p>\u8ff7\u3063\u305f\u6642\u306f\u3001\u307e\u305a1\u3064\u306e\u30e1\u30bf\u30ad\u30fc\u30681\u3064\u306e\u5024\u3060\u3051\u3067\u6700\u5c0f\u69cb\u6210\u3092\u4f5c\u308a\u307e\u3059\u3002\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u3001\u6570\u5024\u6bd4\u8f03\u3001`IN`\u3001`LIKE`\u3001`EXISTS`\u3001\u8907\u6570\u6761\u4ef6\u3078\u5e83\u3052\u308b\u3068\u5b89\u5168\u3067\u3059\u3002<\/p>\n<section class=\"final-checklist wpq-checklist-card wpq-checklist-card--final\"><div class=\"final-checklist-head\"><span class=\"final-checklist-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"check\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M20 6 9 17l-5-5\" \/>\n<\/svg><\/span><h2>compare \u306e\u6700\u7d42\u30c1\u30a7\u30c3\u30af<\/h2><\/div><ul class=\"wpq-checklist\"><li><code>compare<\/code> \u306f <code>meta_query<\/code> \u5185\u306e\u6bd4\u8f03\u65b9\u6cd5\u3060\u3068\u7406\u89e3\u3057\u3066\u3044\u308b<\/li><li><code>key<\/code>\u3001<code>value<\/code>\u3001<code>compare<\/code>\u3001<code>type<\/code> \u306e\u5f79\u5272\u3092\u5206\u3051\u3066\u78ba\u8a8d\u3057\u305f<\/li><li>\u5b8c\u5168\u4e00\u81f4\u3001\u5927\u5c0f\u6bd4\u8f03\u3001\u90e8\u5206\u4e00\u81f4\u3001\u5b58\u5728\u78ba\u8a8d\u306e\u3069\u308c\u304c\u76ee\u7684\u304b\u6c7a\u3081\u305f<\/li><li>\u6570\u5024\u6bd4\u8f03\u3067\u306f <code>type =&gt; &#039;NUMERIC&#039;<\/code> \u3068\u4fdd\u5b58\u5f62\u5f0f\u3092\u78ba\u8a8d\u3057\u305f<\/li><li><code>EXISTS<\/code> \u3068 <code>=<\/code> \u306e\u9055\u3044\u3092\u78ba\u8a8d\u3057\u305f<\/li><li>\u307e\u305a\u306f1\u6761\u4ef6\u3060\u3051\u306e\u6700\u5c0f\u69cb\u6210\u3067\u53d6\u5f97\u3067\u304d\u308b\u304b\u78ba\u8a8d\u3057\u305f<\/li><\/ul><\/section>\n","protected":false},"excerpt":{"rendered":"<p>compare \u306f\u3001WP_Query \u306e meta_query \u3067\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u5024\u3092\u3069\u3046\u6bd4\u8f03\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3067\u3059\u3002\u4e00\u81f4\u3001\u4ee5\u4e0a\u3001\u4ee5\u4e0b\u3001\u90e8\u5206\u4e00\u81f4\u3001\u5b58\u5728\u78ba\u8a8d\u306a\u3069\u306e\u4f7f\u3044\u5206\u3051\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":3789,"template":"","meta":{"wpq_kicker":"\u7528\u8a9e\u96c6","wpq_lead":"compare \u306f\u3001WP_Query \u306e meta_query \u306e\u4e2d\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u3069\u3046\u6bd4\u8f03\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u3067\u3059\u3002\u5024\u304c\u4e00\u81f4\u3059\u308b\u6295\u7a3f\u3092\u63a2\u3059\u306e\u304b\u3001\u6307\u5b9a\u5024\u4ee5\u4e0a\u306e\u6295\u7a3f\u3092\u63a2\u3059\u306e\u304b\u3001\u5024\u304c\u5b58\u5728\u3059\u308b\u6295\u7a3f\u3092\u63a2\u3059\u306e\u304b\u306b\u3088\u3063\u3066\u3001\u4f7f\u3046\u6bd4\u8f03\u6f14\u7b97\u5b50\u304c\u5909\u308f\u308a\u307e\u3059\u3002","wpq_hero_title_line1":"WP_Query \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc","wpq_hero_title_line2":"compare","wpq_hero_title_accent":"compare","wpq_hero_thumbnail_alt":"compare \u306e\u6982\u8981\u30a4\u30e1\u30fc\u30b8","wpq_hero_summary_mode":"","wpq_hero_summary_label":"","wpq_hero_summary_items":"","wpq_reading_time":"","wpq_updated_label":"","wpq_official_links":"WP_Query Class|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\nWP_Meta_Query|https:\/\/developer.wordpress.org\/reference\/classes\/wp_meta_query\/","wpq_update_history":"","wpq_pr_notice":"","footnotes":""},"wpq_glossary_group":[53],"wpq_glossary_attribute":[38,45],"class_list":["post-410","wpq_glossary","type-wpq_glossary","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary"}],"about":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/types\/wpq_glossary"}],"author":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":2,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/410\/revisions"}],"predecessor-version":[{"id":3999,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/410\/revisions\/3999"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media\/3789"}],"wp:attachment":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"wpq_glossary_group","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary_group?post=410"},{"taxonomy":"wpq_glossary_attribute","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary_attribute?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}