How To Add Pinterest Share Button in PHP Website?

Reading Time: 3 minutes

In today’s digital landscape, social media sharing has become a vital aspect of online presence and content dissemination. Integrating social sharing buttons into websites not only enhances user engagement but also extends the reach of content across various platforms. Adding a Pinterest Share button to a PHP website allows visitors to effortlessly share website content on their Pinterest boards, thereby increasing visibility and driving traffic to the site.

This comprehensive guide aims to provide a detailed walkthrough of adding a Pinterest Share button to a PHP website. Whether you’re a novice or an experienced developer, this tutorial will guide you through the process, ensuring seamless integration of the Share button into your website.

Read More: How To Add Facebook Share Button in PHP Website?

Let’s get started.

Sample Application Setup

Create a file named as “index.php“. Write the following code into it,

<!DOCTYPE html>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>How To Add pinterest Share Button in PHP - Online Web Tutor</title>
  <link href="" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="container">
  <h2>How To Add Pinterest Share Button in PHP - Online Web Tutor</h2>
      $url = "";
      $image = "";
      $title = "What's New in Laravel 11: New Features and Latest Updates
  <a href="'
<?php echo $url ?>&media=<?php echo $image ?>&description=<?php echo $title ?>', '_blank', 'width=400,height=500');void(0);" class="btn btn-danger">Share on Pinterest</a>


That’s it.

We hope this article helped you to learn about “How To Add Pinterest Share Button in PHP Website” in a explained way.

Online Web Tutor invites you to try Skillshike! Learn CakePHP, Laravel, CodeIgniter, Node Js, MySQL, Authentication, RESTful Web Services, etc into a depth level. Master the Coding Skills to Become an Expert in PHP Web Development. So, Search your favourite course and enroll now.

If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.

Sanjay KumarHello friends, I am Sanjay Kumar a Web Developer by profession. Additionally I'm also a Blogger, Youtuber by Passion. I founded Online Web Tutor and Skillshike platforms. By using these platforms I am sharing the valuable knowledge of Programming, Tips and Tricks, Programming Standards and more what I have with you all. Read more