{"id":23205,"date":"2015-01-29T18:01:35","date_gmt":"2015-01-29T10:01:35","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=23205"},"modified":"2025-04-04T00:05:24","modified_gmt":"2025-04-03T16:05:24","slug":"wordpress-custom-meta-box","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/","title":{"rendered":"Creating Custom Meta Boxes in WordPress"},"content":{"rendered":"<p>In a previous post, we discussed the <a href=\"https:\/\/www.hongkiat.com\/blog\/create-wordpress-custom-field\/\">WordPress custom field<\/a>, which allows you to add and display new entries in a post using the Custom Field box provided in the post editing screen. If you prefer an alternative to using the custom field box, you can create a meta box instead.<\/p>\n<p>A meta box is a <strong>customized interface<\/strong> that we create ourselves, which may <strong>include input fields or other interactive elements to add new entries<\/strong> for posts or pages. This method serves the same purpose as the Custom Field box, so let\u2019s explore how to create one.<\/p>\n<p><strong>Related Articles on Hongkiat.com:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-upload-dir\/\">Customize media upload directory in WordPress<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/customize-wordpress-editor-styles\/\">Customize WordPress editor styles<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-howdy-customized\/\">Customize \u201cHowdy\u201d in the WordPress admin bar<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-taxonomy-for-users\/\">Register custom taxonomy for WordPress users<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-menu-icon\/\">Display icons in the WordPress menu<\/a><\/li>\n<\/ul>\n<h2>Creating a Meta Box<\/h2>\n<p>WordPress provides an API function called <code>add_meta_box<\/code>, which allows us to create a meta box easily. Here\u2019s a basic implementation:<\/p>\n<pre>\r\nfunction add_post_reference() {\r\n    add_meta_box('post-reference', 'Reference', 'referenceCallBack', 'post');\r\n}\r\nadd_action('add_meta_boxes', 'add_post_reference');\r\n\r\nfunction referenceCallBack() {\r\n    echo 'Hello World';\r\n}\r\n<\/pre>\n<p>The <code>add_meta_box<\/code> function accepts four parameters: the ID, the meta box title, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/stackoverflow.com\/questions\/824234\/what-is-a-callback-function\">a callback function<\/a>, and the post type in which to display the meta box. In this case, we add a new meta box to the post editing page (this also works with pages).<\/p>\n<p>In the post editing section, you will see the new box as follows:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg\" height=\"280\" width=\"600\" alt=\"Basic WordPress meta box interface\"><\/figure>\n<p>The new meta box, as shown above, appears below <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/TinyMCE\">the WYSIWYG editor<\/a>. If you prefer to position it in the sidebar, add \u2018side\u2019 after the post parameter and \u2018high\u2019 if you want it at the top of the sidebar:<\/p>\n<pre>\r\nfunction add_post_reference() {\r\n    add_meta_box('post-reference', 'Reference', 'referenceCallBack', 'post', 'side', 'high');\r\n}\r\nadd_action('add_meta_boxes', 'add_post_reference');\r\n<\/pre>\n<p>This places it above the <strong>Publish<\/strong> box.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box-position.jpg\" height=\"280\" width=\"600\" alt=\"WordPress meta box positioned above publish box\"><\/figure>\n<p>Next, we will replace the \u2018Hello World\u2019 text with input fields for new entries.<\/p>\n<p>In this example, we will add two input fields: one for the Reference Name and another for the Reference Link:<\/p>\n<pre>\r\nfunction referenceCallBack($post) {\r\n    wp_nonce_field('reference_meta_box', 'reference_nonce');\r\n\r\n    $name_value = get_post_meta($post->ID, '_post_reference_name', true);\r\n    $link_value = get_post_meta($post->ID, '_post_reference_link', true);\r\n\r\n    echo '<label for=\"reference-name\">Reference Name<\/label>';\r\n    echo '<input type=\"text\" id=\"reference-name\" name=\"post_reference_name\" placeholder=\"Example\" value=\"' . esc_attr($name_value) . '\" size=\"25\">';\r\n    echo '<p class=\"howto\">Add the name of the reference<\/p>';\r\n\r\n    echo '<label for=\"reference-link\">Reference Link<\/label>';\r\n    echo '<input type=\"text\" id=\"reference-link\" name=\"post_reference_link\" placeholder=\"http:\/\/www.example.com\/\" value=\"' . esc_attr($link_value) . '\" size=\"25\">';\r\n    echo '<p class=\"howto\">Add the link of the reference<\/p>';\r\n}\r\n<\/pre>\n<p>Refresh the post editing page to see these two new input fields added.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box-inputs.jpg\" height=\"280\" width=\"600\" alt=\"WordPress meta box with input fields\"><\/figure>\n<p>The <code>$name_value<\/code> and <code>$link_value<\/code> variables retrieve entries from the database and populate the input fields. To save the entries into the database, we will need to create a new function named <code>save_post_reference<\/code>:<\/p>\n<pre>\r\nfunction save_post_reference($post_id) {\r\n}\r\nadd_action('save_post', 'save_post_reference');\r\n<\/pre>\n<p>For security purposes, we need to verify several things:<\/p>\n<p><em>(1) <\/em>Check if the user <strong>has permission to edit the post<\/strong>:<\/p>\n<pre>\r\nif (!current_user_can('edit_post', $post_id)) {\r\n    return;\r\n}\r\n<\/pre>\n<p><em>(2) <\/em>Ensure the <strong>Nonce is set<\/strong>:<\/p>\n<pre>\r\nif (!isset($_POST['reference_nonce'])) {\r\n    return;\r\n}\r\nif (!wp_verify_nonce($_POST['reference_nonce'], 'reference_meta_box')) {\r\n    return;\r\n}\r\n<\/pre>\n<p><em>(3) <\/em>Prevent auto-saving; data can only be saved when the \u201cSave\u201d or \u201cUpdate\u201d button is clicked:<\/p>\n<pre>\r\nif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\r\n    return;\r\n}\r\n<\/pre>\n<p><em>(4) <\/em>Ensure that our inputs, <code>post_reference_name<\/code> and <code>post_reference_link<\/code>, are set before submission:<\/p>\n<pre>\r\nif (!isset($_POST['post_reference_name']) || !isset($_POST['post_reference_link'])) {\r\n    return;\r\n}\r\n<\/pre>\n<p><em>(5) <\/em>Sanitize the inputs to prevent unexpected characters that could compromise security. Use the WordPress built-in function <code><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/codex.wordpress.org\/Function_Reference\/sanitize_text_field\">sanitize_text_field<\/a><\/code>:<\/p>\n<pre>\r\n$reference_name = sanitize_text_field($_POST['post_reference_name']);\r\n$reference_link = sanitize_text_field($_POST['post_reference_link']);\r\n<\/pre>\n<p>Now we can save the entries into the database:<\/p>\n<pre>\r\nupdate_post_meta($post_id, '_post_reference_name', $reference_name);\r\nupdate_post_meta($post_id, '_post_reference_link', $reference_link);\r\n<\/pre>\n<p>Try it out by entering some content into the input fields and clicking the \u201cUpdate\u201d button to save your entries.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box-final.jpg\" height=\"380\" width=\"500\" alt=\"Final WordPress meta box with saved entries\"><\/figure>\n<h2>Conclusion<\/h2>\n<p>We have created a meta box with two input fields. You can further extend this box with other input types, such as radio buttons or select boxes. This example serves as a foundation; once you\u2019re familiar with it, you can utilize this meta box for more complex applications. Share your thoughts on how you plan to use this meta box!<\/p>","protected":false},"excerpt":{"rendered":"<p>In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided in the post editing screen. If you prefer an alternative to using the custom field box, you can create a meta box instead. A meta box is&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,252],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Creating Custom Meta Boxes in WordPress - Hongkiat<\/title>\n<meta name=\"description\" content=\"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Custom Meta Boxes in WordPress\" \/>\n<meta property=\"og:description\" content=\"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-29T10:01:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T16:05:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Creating Custom Meta Boxes in WordPress\",\"datePublished\":\"2015-01-29T10:01:35+00:00\",\"dateModified\":\"2025-04-03T16:05:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/\"},\"wordCount\":496,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-custom-meta-box\\\/wordpress-meta-box.jpg\",\"keywords\":[\"ad-divi\",\"WordPress Tips\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/\",\"name\":\"Creating Custom Meta Boxes in WordPress - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-custom-meta-box\\\/wordpress-meta-box.jpg\",\"datePublished\":\"2015-01-29T10:01:35+00:00\",\"dateModified\":\"2025-04-03T16:05:24+00:00\",\"description\":\"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-custom-meta-box\\\/wordpress-meta-box.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-custom-meta-box\\\/wordpress-meta-box.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-custom-meta-box\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating Custom Meta Boxes in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Creating Custom Meta Boxes in WordPress - Hongkiat","description":"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/","og_locale":"en_US","og_type":"article","og_title":"Creating Custom Meta Boxes in WordPress","og_description":"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided","og_url":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2015-01-29T10:01:35+00:00","article_modified_time":"2025-04-03T16:05:24+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Creating Custom Meta Boxes in WordPress","datePublished":"2015-01-29T10:01:35+00:00","dateModified":"2025-04-03T16:05:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/"},"wordCount":496,"commentCount":5,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg","keywords":["ad-divi","WordPress Tips"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/","url":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/","name":"Creating Custom Meta Boxes in WordPress - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg","datePublished":"2015-01-29T10:01:35+00:00","dateModified":"2025-04-03T16:05:24+00:00","description":"In a previous post, we discussed the WordPress custom field, which allows you to add and display new entries in a post using the Custom Field box provided","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-custom-meta-box\/wordpress-meta-box.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-custom-meta-box\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating Custom Meta Boxes in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-62h","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=23205"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23205\/revisions"}],"predecessor-version":[{"id":73483,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/23205\/revisions\/73483"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=23205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=23205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=23205"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=23205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}