{"id":24260,"date":"2015-07-07T23:01:44","date_gmt":"2015-07-07T15:01:44","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=24260"},"modified":"2023-08-15T01:18:03","modified_gmt":"2023-08-14T17:18:03","slug":"wordpress-speed-optimization-social-sharing-icons","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/","title":{"rendered":"Optimize WordPress Speed with Custom Social Sharing Icons"},"content":{"rendered":"<p>It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean simple, lightweight, resource-friendly, fast \u2013 most social sharing plugins out there are not like that. They tend to eat up resources like crazy, and <strong>why would anyone want to increase the plugin load time by 25-35% just to display some icons<\/strong> on their site?<\/p>\n<p>The good news is that you don\u2019t necessarily need a plugin to accomplish this task. In this tutorial, I will show you how you can easily <strong>add custom social sharing buttons<\/strong> to the end of the posts on your WordPress site with <strong>just a few lines of code<\/strong>.<\/p>\n<h2>Step 1: Generate the Social Sharing Buttons<\/h2>\n<p>We will use the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/simplesharingbuttons.com\/\">Simple Sharing Buttons Generator<\/a>, a handy and easy-to-use web tool to generate the sharing icons. The main advantage of this app is that the buttons it generates run on the frontend, therefore <strong>they won\u2019t burden your server<\/strong> and you can also keep your users\u2019 activities private.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg\" width=\"700\" height=\"425\"><\/figure>\n<p>To generate your custom buttons, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/simplesharingbuttons.com\/\">go here<\/a> and press <strong>Begin<\/strong>. Choose 1 from the 6 different button styles. Click <strong>next<\/strong> and tick the <strong>social networks<\/strong> you want to add to your site. When you are finished, you will have to fill your website\u2019s info.<\/p>\n<p>On this screen (below), you will find two options: <strong>\u2018No JavaScript\u2019<\/strong> and <strong>\u2018JavaScript\u2019<\/strong>. Tick <strong>JavaScript<\/strong>, as it will enable the browser to detect the URL dynamically therefore your visitors will be able to share each post individually not just the URL of the home page.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/your-website-info.jpg\" width=\"870\" height=\"592\"><\/figure>\n<p>Finally take a look at the live preview, download the chosen icon set, and grab the code you generated.<\/p>\n<h2>Step 2: Create a Child Theme<\/h2>\n<p>Now you will have to add the generated icons and code to your site. First of all you will need to create a child theme.<\/p>\n<p>You can easily create a WP child theme with the help of <a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-child-themes-dev\/\">our tutorial<\/a>, or you can follow the steps of this <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Child_Themes#How_to_Create_a_Child_Theme\">WP Codex article<\/a>. If you already have one, you can jump to Step 3.<\/p>\n<p>The child theme relates to the theme you currently use \u2013 in a somewhat similar way as a child relates to his parents. It <strong>inherits everything (style and functionality) from the parent theme<\/strong> but you can <strong>add extra functionality<\/strong> to it.<\/p>\n<p>In our case the extra functionality will be the custom social sharing buttons.<\/p>\n<h2>Step 3: Create a Custom Function that Displays the Icons<\/h2>\n<p>We will add a custom function to the child theme\u2019s functions.php file.<\/p>\n<p>With the help of this function you will be able to add the social icons wherever you want on your site by using a custom <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Plugin_API\/Action_Reference\">action hook<\/a>. If your child theme doesn\u2019t have a functions.php file yet, create a blank text file in your child theme\u2019s root folder with the name functions, and change its extension to .php.<\/p>\n<p>Insert the following line of code into this blank file:<\/p>\n<pre>&lt;?php<\/pre>\n<p>When your <strong>functions.php<\/strong> file is set up add the following code snippet to it:<\/p>\n<pre>\r\n function add_social_sharing() { ?&gt;\r\n &lt;h3&gt;Share this post&lt;h3&gt;\r\n &lt;!-- Comment: here comes the generated HTML code --&gt;\r\n &lt;?php\r\n add_action( 'custom_social_share', 'add_social_sharing' );\r\n <\/pre>\n<p>Finally <strong>delete the line of the HTML comment<\/strong> from the code snippet above and <strong>replace it with the HTML code<\/strong> you generated in Step 1 with the Social Sharing Buttons Generator.<\/p>\n<h2>Step 4: Copy the Appropriate Template File to the Child Theme Folder<\/h2>\n<p>By default, single posts are ruled by a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Template_Hierarchy\">template file<\/a> called <strong>single.php<\/strong>. Sometimes \u2013 especially in more modern themes \u2013 the structure of <strong>single.php<\/strong> is more complicated, as it also loads additional template files. In this step we need to find the appropriate template file where we can add the icons later.<\/p>\n<p>To locate the right spot for the social buttons we need to find the template file that <strong>contains the function that loads the content of the single posts<\/strong>.<\/p>\n<p>Let\u2019s open the theme editor in the WordPress admin dashboard under <strong>Appearance &gt; Editor<\/strong>. On the top right hand corner you find a dropdown list where you can select your parent theme. Below the dropdown you can see all the template files your parent theme contains. Scroll down until you find the <strong>Single Post template<\/strong> (called single.php) and open it.<\/p>\n<p>If the parent theme uses the <strong>get_template_part()<\/strong> WP function in the <strong>single.php<\/strong> file that means it uses an additional template file to load the content of the single post.<\/p>\n<p>First you have to find out which one is this. The name of the additional template file is the first parameter of the <strong>get_template_part()<\/strong> function.<\/p>\n<p>In <strong>Twenty Fifteen<\/strong> it looks like this:<\/p>\n<pre>get_template_part( 'content', get_post_format() );<\/pre>\n<p>The first parameter is <strong>\u2018content\u2019<\/strong> which means we look for the template file called <strong>content.php<\/strong>. You need to copy this file from the parent theme root folder to the child theme root folder so as to modify it.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/twentyfifteen-parent-location.jpg\" alt=\"Twenty Fifteen File Location\" width=\"700\" height=\"717\"><\/figure>\n<h2>Step 5: Add the Action Hook to the Right Template File<\/h2>\n<p>We created a function called <strong>add_social_sharing()<\/strong> in Step 3, and we attached it to a custom action hook called <strong>custom_social_share<\/strong>. Now we will have to add this hook to the spot where we want the function to be executed.<\/p>\n<p>Here is the code snippet you will need to insert to the right place:<\/p>\n<pre>&lt;?php do_action( 'custom_social_share' ); ?&gt;<\/pre>\n<p>Next, let\u2019s find the right place.<\/p>\n<p>Open the template file you added to your child theme in Step 4 in a code editor or inside the theme editor of the WordPress admin dashboard, and look for the <strong>the_content()<\/strong> function.<\/p>\n<p>Check if there is a <strong>wp_link_pages()<\/strong> function right after the <strong>the_content()<\/strong> function. If there is, then the code snippet above comes after that; otherwise it follows the <strong>the_content()<\/strong> function.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/twentyfifteen-theme-editor.jpg\" alt=\"Action hook in the Twenty Fifteen theme\" width=\"700\" height=\"420\"><\/figure>\n<h2>Step 6: Add the CSS Code to the Child Theme<\/h2>\n<p>Open the <strong>style.css<\/strong> file of your child theme either in your code editor or in the theme editor of the WordPress admin dashboard, copy the CSS code you generated in Step 1, paste it to the end of the file, and save it.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/grab-the-code.jpg\" alt=\"Download the HTML and CSS codes\" width=\"700\" height=\"420\"><\/figure>\n<p>We will add two extra lines to the CSS file to make the social sharing icons properly display in each theme. Copy and paste the following code snippet to the end of the <strong>style.css<\/strong> file:<\/p>\n<pre>\r\n ul.share-buttons li a {\r\n border: 0;\r\n }\r\n ul.share-buttons li img {\r\n display: inline;\r\n }\r\n <\/pre>\n<h2>Step 7: Upload the Social Media Icon Set to the Server<\/h2>\n<p>Upload the chosen social media icon set you downloaded in Step 1 to your child theme folder. Connect your server via FTP, create a new folder called <strong>images<\/strong> inside the root of your child theme folder (\/wp-content\/themes\/your-child-theme\/images) and upload the icon set here.<\/p>\n<p>We name the folder <strong>images<\/strong> because this is the default name of the image folder the Simple Sharing Buttons Generator uses.<\/p>\n<h2>Step 8: Check the Path of the Icon Files<\/h2>\n<p>After you uploaded the social media icons to your server in Step 7, it\u2019s important to check the path of the icon files to make sure they will be loaded.<\/p>\n<p>The path of an image file gives a hint to the browser about its location on the server. Let\u2019s check the image paths inside the <strong>functions.php<\/strong> file of the child theme. Open the file in your code editor, and navigate to the <strong>add_social_sharing()<\/strong> function where you need to check the HTML code you generated with the Simple Sharing Buttons Generator.<\/p>\n<p>In the HTML code you will find an <strong>&lt;img&gt;<\/strong> tag with an <strong>src<\/strong> attribute for each icon. Check if each <strong>src<\/strong> attributes points to the exact location where your icon set was uploaded in Step 7.<\/p>\n<p>The Simple Sharing Buttons Generator adds relative paths to the <strong>&lt;img&gt;<\/strong> files. Sometimes <strong>browsers can\u2019t render the images if you use a relative path<\/strong>, so it\u2019s a good idea to <strong>use absolute paths instead<\/strong>. This way each browser potentially used by your visitors can be dead sure about the location of the required icon files.<\/p>\n<p>The relative image path added by the generator looks something like this:<\/p>\n<pre>&lt;img src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/flat_web_icon_set\/color\/Twitter.png\"&gt;<\/pre>\n<p>Let\u2019s change the <strong>src<\/strong> attribute of each icon to an absolute path which means it will include the full URL of the file.<\/p>\n<p>The URL path above will look like this:<\/p>\n<pre>&lt;img src=\"http:\/\/wwww.your-wp-site\/wp-content\/themes\/your-child-theme\/https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/flat_web_icon_set\/color\/Twitter.png\"&gt;<\/pre>\n<h2>Step 9: Upload the Modified Files and Activate the Child Theme<\/h2>\n<p>Connect your server via FTP and upload all files we created in this tutorial that you haven\u2019t uploaded yet: the <strong>functions.php<\/strong>, the <strong>style.css<\/strong>, and the appropriate template file (in this tutorial either the <strong>single.php<\/strong> or the <strong>content.php<\/strong>).<\/p>\n<p>Finally activate the child theme in the WP admin dashboard under the <strong>Appearance &gt; Themes<\/strong> menu.<\/p>\n<p>Now you are ready with your super-lightweight, resource-saving, customized social sharing icons. You can go online and check it live on your site.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/twentyfifteen-final.jpg\" alt=\"The result in the Twenty Fifteen Theme\" width=\"700\" height=\"420\"><\/figure>\n<h2>Conclusion<\/h2>\n<p>In this tutorial I showed you how to add the custom social sharing buttons to the end of single posts. You can add the sharing icons to any other locations on your website with the help of the action hook we created.<\/p>\n<p>Just add the code we used in Step 5 to the spot where you want the buttons to be displayed:<\/p>\n<pre>&lt;?php do_action( 'custom_social_share' ); ?&gt;<\/pre>\n<p>You will also have to find the right template file if you want to place the icons somewhere else. Single pages are ruled by a template file called <strong>page.php<\/strong>, while media attachments like images are loaded by <strong>attachment.php<\/strong>.<\/p>\n<p>If you wish to display the social sharing buttons on a different spot on your website, you can use the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codex.wordpress.org\/Template_Hierarchy#The_Template_Hierarchy_In_Detail\">WordPress Template Hierarchy<\/a> to find it.<\/p>\n<ul class=\"download download-1c\">\n<li> <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/wordpress-social-sharing-icons\/\">Download Source<\/a> <\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean simple, lightweight, resource-friendly, fast \u2013 most social sharing plugins out there are not like that. They tend to eat up resources like crazy, and why would anyone&hellip;<\/p>\n","protected":false},"author":146,"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],"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>Optimize WordPress Speed with Custom Social Sharing Icons - Hongkiat<\/title>\n<meta name=\"description\" content=\"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean\" \/>\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-speed-optimization-social-sharing-icons\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimize WordPress Speed with Custom Social Sharing Icons\" \/>\n<meta property=\"og:description\" content=\"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/\" \/>\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-07-07T15:01:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-14T17:18:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg\" \/>\n<meta name=\"author\" content=\"Anna Monus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anna Monus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 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-speed-optimization-social-sharing-icons\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/\"},\"author\":{\"name\":\"Anna Monus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/a601053a0ab457901e00cdc83bd5359e\"},\"headline\":\"Optimize WordPress Speed with Custom Social Sharing Icons\",\"datePublished\":\"2015-07-07T15:01:44+00:00\",\"dateModified\":\"2023-08-14T17:18:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/\"},\"wordCount\":1577,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-speed-optimization-social-sharing-icons\\\/simple-sharing-button-generator.jpg\",\"keywords\":[\"ad-divi\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/\",\"name\":\"Optimize WordPress Speed with Custom Social Sharing Icons - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-speed-optimization-social-sharing-icons\\\/simple-sharing-button-generator.jpg\",\"datePublished\":\"2015-07-07T15:01:44+00:00\",\"dateModified\":\"2023-08-14T17:18:03+00:00\",\"description\":\"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-speed-optimization-social-sharing-icons\\\/simple-sharing-button-generator.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/wordpress-speed-optimization-social-sharing-icons\\\/simple-sharing-button-generator.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-speed-optimization-social-sharing-icons\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimize WordPress Speed with Custom Social Sharing Icons\"}]},{\"@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\\\/a601053a0ab457901e00cdc83bd5359e\",\"name\":\"Anna Monus\",\"description\":\"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.\",\"sameAs\":[\"https:\\\/\\\/www.annalytic.com\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/anna_monus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Optimize WordPress Speed with Custom Social Sharing Icons - Hongkiat","description":"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean","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-speed-optimization-social-sharing-icons\/","og_locale":"en_US","og_type":"article","og_title":"Optimize WordPress Speed with Custom Social Sharing Icons","og_description":"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean","og_url":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2015-07-07T15:01:44+00:00","article_modified_time":"2023-08-14T17:18:03+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg","type":"","width":"","height":""}],"author":"Anna Monus","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Anna Monus","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/"},"author":{"name":"Anna Monus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/a601053a0ab457901e00cdc83bd5359e"},"headline":"Optimize WordPress Speed with Custom Social Sharing Icons","datePublished":"2015-07-07T15:01:44+00:00","dateModified":"2023-08-14T17:18:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/"},"wordCount":1577,"commentCount":11,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg","keywords":["ad-divi"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/","url":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/","name":"Optimize WordPress Speed with Custom Social Sharing Icons - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg","datePublished":"2015-07-07T15:01:44+00:00","dateModified":"2023-08-14T17:18:03+00:00","description":"It may seem to be an easy task but adding well-behaving social sharing buttons to a WordPress site can be a hassle. When I say well-behaving I mean","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/wordpress-speed-optimization-social-sharing-icons\/simple-sharing-button-generator.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-speed-optimization-social-sharing-icons\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Optimize WordPress Speed with Custom Social Sharing Icons"}]},{"@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\/a601053a0ab457901e00cdc83bd5359e","name":"Anna Monus","description":"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.","sameAs":["https:\/\/www.annalytic.com\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/anna_monus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-6ji","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24260","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\/146"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=24260"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24260\/revisions"}],"predecessor-version":[{"id":68784,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/24260\/revisions\/68784"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=24260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=24260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=24260"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=24260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}