URLをコピーしました!
スキルアップを始める!

【WordPress】Googleしごと検索(Google for Jobs)に求人を掲載する方法part4【一旦JSON-LDコードのおさらい】

WordPress(ワードプレス)
\ワードプレスのスキルアップはこちら!/ WordPress入門読本

前回までで「求人管理」機能を追加して、カスタムフィールドをカラムに表示させる部分を作成できました。

ここで、一旦Googleしごと検索と、カスタムフィールドについておさらいをしたいと思います。

Googleしごと検索(Google for Jobs)とは?

前回の復習ですが、「Googleしごと検索(Google for Jobs)」とは、2019年1月から日本でサービス開始されたGoogleの求人情報サービスです。構造化されたページを用意して公開すると、Googleの検索結果画面に表示される仕組みになっています。

求人情報に構造化データを追加する
JobPosting 構造化データを求人情報のウェブページに追加すると、求職に関するエクスペリエンスを向上させることができます。構造化データの追加により、求人情報を Google 検索結果に表示して、特別なユーザー エクスペリエンスを提供できるようになります。また、サードパーティの求人サイトを利用して、Google に統合することも可能です。

https://developers.google.com/search/docs/advanced/structured-data/job-posting?hl=ja

カスタムフィールドをエクスポートする

アドバンスドカスタムフィールドの「ツール」から、JSONファイルをエクスポートできます。

エクスポートしたいカスタムフィールドを選択して、「Export File」を選択します。

ツールからエクスポートを実行すると、JSONファイルがエクスポートされました。

JSON-LD(ジェイソンエルディー)とは?

JSON-LDとは、「JSON for Linking Data」と呼ばれる形式で、主にWeb上で情報を公開および使用するために使われる軽量なJSONデータと呼ばれるものです。構造化データを作成する際に使われる便利なフォーマットでGoogleもJSON-LDを推奨しているそうです。

シンプルに書くと下記のようなデータ(サンプル)となっています。

{
  "@context": "https://json-ld.org/contexts/person.jsonld",
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}

JSON for Linking Data【公式?】

JSON-LD コードを使用する

前回のおさらいですが、カスタムフィールドを順番に作成して、完成されたファイルをエクスポートすると、下記のようなJSON-LD コードとなりました。そのままjsonファイルとしてインポートして使用することも可能です。jsonファイルを作ってみたいという方は、当サイトの会員登録をしてもらうか、共にワードプレスのスキルアップをしていきましょう😃↓jsonデータはこちら

[rml_read_more]

[
    {
        "key": "group_62120cebbbaa8",
        "title": "Googleしごと検索",
        "fields": [
            {
                "key": "field_62120d0296a1b",
                "label": "Googleしごと検索の有効化",
                "name": "activation",
                "type": "checkbox",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "choices": {
                    "yes": "する"
                },
                "allow_custom": 0,
                "default_value": [],
                "layout": "vertical",
                "toggle": 0,
                "return_format": "value",
                "save_custom": 0
            },
            {
                "key": "field_62120d1d96a1c",
                "label": "職務名",
                "name": "jobTitle",
                "type": "text",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            },
            {
                "key": "field_62120d2b96a1d",
                "label": "会社名",
                "name": "companyName",
                "type": "text",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            },
            {
                "key": "field_62120d3996a1e",
                "label": "サイトURL",
                "name": "siteUrl",
                "type": "url",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": ""
            },
            {
                "key": "field_62120d5096a1f",
                "label": "ロゴ画像URL",
                "name": "logoimage",
                "type": "url",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": ""
            },
            {
                "key": "field_62120d5a96a20",
                "label": "郵便番号",
                "name": "postalCode",
                "type": "number",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "min": "",
                "max": "",
                "step": ""
            },
            {
                "key": "field_62120d6d4cdf0",
                "label": "都道府県",
                "name": "addressRegion",
                "type": "text",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            },
            {
                "key": "field_62120dd04cdf1",
                "label": "市区町村",
                "name": "addressLocality",
                "type": "text",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            },
            {
                "key": "field_62120ddd4cdf2",
                "label": "町名以降",
                "name": "streetAddress",
                "type": "text",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            },
            {
                "key": "field_62120de54cdf3",
                "label": "給与額の設定",
                "name": "setValue",
                "type": "radio",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "choices": {
                    "basic": "基本給で指定",
                    "min_max": "最低額・最高額で指定"
                },
                "allow_null": 0,
                "other_choice": 0,
                "default_value": "",
                "layout": "vertical",
                "return_format": "value",
                "save_other_choice": 0
            },
            {
                "key": "field_62120e144cdf4",
                "label": "基本給の額",
                "name": "basicvalue",
                "type": "number",
                "instructions": "",
                "required": 0,
                "conditional_logic": [
                    [
                        {
                            "field": "field_62120de54cdf3",
                            "operator": "==",
                            "value": "basic"
                        }
                    ]
                ],
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "min": "",
                "max": "",
                "step": ""
            },
            {
                "key": "field_62120e424cdf5",
                "label": "最低額",
                "name": "minValue",
                "type": "number",
                "instructions": "",
                "required": 0,
                "conditional_logic": [
                    [
                        {
                            "field": "field_62120de54cdf3",
                            "operator": "==",
                            "value": "min_max"
                        }
                    ]
                ],
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "min": "",
                "max": "",
                "step": ""
            },
            {
                "key": "field_62120e754cdf6",
                "label": "最高額",
                "name": "maxValue",
                "type": "number",
                "instructions": "",
                "required": 0,
                "conditional_logic": [
                    [
                        {
                            "field": "field_62120de54cdf3",
                            "operator": "==",
                            "value": "min_max"
                        }
                    ]
                ],
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "min": "",
                "max": "",
                "step": ""
            },
            {
                "key": "field_62120ead4cdf7",
                "label": "時間の単位",
                "name": "unitText",
                "type": "radio",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "choices": {
                    "MONTH": "1ヶ月あたり",
                    "DAY": "1日あたり",
                    "HOUR": "1時間あたり",
                    "WEEK": "1週あたり",
                    "YEAR": "1年あたり"
                },
                "allow_null": 0,
                "other_choice": 0,
                "default_value": "",
                "layout": "vertical",
                "return_format": "value",
                "save_other_choice": 0
            },
            {
                "key": "field_62120f1b4cdf8",
                "label": "雇用形態",
                "name": "employmentType",
                "type": "radio",
                "instructions": "FULL_TIME : フルタイム\r\nPART_TIME : パートタイム、アルバイト\r\nCONTRACTOR : 個人請負\r\nTEMPORARY : 派遣\r\nINTERN : インターン\r\nVOLUNTEER : ボランティア\r\nPER_DIEM : 日雇い\r\nOTHER : その他",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "choices": [],
                "allow_null": 0,
                "other_choice": 0,
                "default_value": "",
                "layout": "vertical",
                "return_format": "value",
                "save_other_choice": 0
            },
            {
                "key": "field_62120f564cdf9",
                "label": "詳細説明",
                "name": "description",
                "type": "wysiwyg",
                "instructions": "",
                "required": 1,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "tabs": "all",
                "toolbar": "full",
                "media_upload": 1,
                "delay": 0
            },
            {
                "key": "field_62120f6c4cdfa",
                "label": "求人の有効期限",
                "name": "validThrough",
                "type": "text",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "prepend": "",
                "append": "",
                "maxlength": ""
            }
        ],
        "location": [
            [
                {
                    "param": "post_type",
                    "operator": "==",
                    "value": "item"
                }
            ]
        ],
        "menu_order": 0,
        "position": "normal",
        "style": "default",
        "label_placement": "top",
        "instruction_placement": "label",
        "hide_on_screen": "",
        "active": true,
        "description": "",
        "show_in_rest": 0
    }
]

上記コードをコピー&貼り付けして「google-for-jobs.json」といったファイル名で保存すると完了です。

まとめ

ということで、前置きが長くなりましたが、JSON-LD(ジェイソンエルディー)とは?についてでした。

続けて、前に作成した「求人管理」という新しい機能(カスタム投稿タイプ)を活用して、公開されたページに表示される仕掛けを作っていきます。長くなりましたので、続きはまた😃

求人管理機能??という方は、過去の記事をご参考ください。

Kindle Unlimited 会員は無料で購読できます
購読はこちら
Kindle Unlimited 会員は無料で購読できます
購読はこちら