Watermarks for your Content Images, without using a WordPress Watermark Plugin.

There is an easy way to automatically integrate WordPress Watermark on your Content Images. You just need a small script and an additional line in your .htaccess

Disclaimer

If you need WordPress help, you can find advice on wordpress.stackexchange.com, where I post regularly as fischi. I do not provide support here.

Save the script as „watermark.php“. Feel free to alter the parameters, every parameter for the watermarks is explained in the code.

The code for creating the Watermark

 

Now you have to alter your .htaccess: Insert the line below. This example is to be used for WordPress, if you don’t want to use a WordPress Watermark Plugin or if you can’t find one that fulfills your needs.
Of course, this script can be used with any other CMS as well: it ddoesn’t matter if it’s Wrdpress, Joomla, SixCMS, Drupal or anything else. The trick is to redirect the images from your upload directory to the watermark.php with a regular expression, and pass the source of the image on with a GET parameter.
ATTENTION! Please do not use this script on every image, because the images in your templates should not be affected by an automatic watermark integration. If you want to do this on purpose, no problem. But it makes no sense to have a Watermark on your icons 😉

The code for enabling WordPress Watermark in your system

Have Fun!
Sometimes it pays off to know PHP, and not just making a collection of WordPress Plugins 🙂 I think most WordPress Watermark Plugins are to inflexible or broken, and if you integrate the Watermark on the upload, you have no possibility to change them, for example if your customerr changes his logo. If you integrate the Watermark on the fly, you should not have a problem with that.
Another plus: You are not dependent on the ongoing improvement of a specific WordPress Watermark Plugin!

Have a nice Day,

fischi.

This was a long time ago… My page looked like this:

wordpress watermark - programmieren seit jahren

19 Kommentare

  1. To be able to choose an online gambling site that can be trustworthy and
    provide the best service, you must know and know first
    with the betting website that you will choose. Also make sure
    the web betting that you find meets the requirements as the best online gambling site.

    Do Research in Forums

    The least difficult way to make sure you can safely use a betting site or not is to learn or participate in discussions with people in internet gambling forums.
    All those in the betting forum are usually experienced players and
    know which wagering sites provides the best service.

    Inquire the Player

    If speaking about in a community forum is difficult that you should do or do not
    know which forum you can visit to do research, we suggest that you directly ask the more experienced players.
    In addition you can also request tips and tricks on the best strategies that may be applied in the game

  2. Hello,
    this code add watermark to all images from wp-content /uploads .. is there any possibility to filter ? like anyname_logo.jpg should not apply this etc

    Thank you

  3. Thank you for the good writeup. It actually used to be a enjoyment account it.
    Glance complex to more delivered agreeable from you! However, how could we keep up a correspondence?

  4. However, after one donation, you arre able to donate again only after a couple of months when your body has regained the donated blood.
    Then write the way appears to be tto yoou and takme notice as
    you lay the caards to learn more abojt yourself watching the
    method that you will discover the hidrden lesson. Over the arrival months I’ll
    be writing some articles revealing the tjps for public relations (everything a journalist
    won’t would like you to know.

    1. Hi, this version does not really work for filtering, as all media is processed.
      You have a few possibilities – if your productimages are a specific size, you can create a Watermark for those, and not for the other pictures. You will need to have something to identify which picture is a product picture, then this is no problem.

  5. hello fischi
    i am create watermark.php file and copy source to file
    and create empty png and watermark png and set to watermark.php
    and set rewrite code to htaccess
    but test it . and not show image in content. my image is broken .
    my image is default wordpress: wp-content/uploads

    test in firefox show error:
    The image “http://mysite.com/wp-content/uploads/2012/04/apple-firstquarter-earnings-report-2012.jpg” cannot be displayed because it contains errors.

    please help me for solve problem
    thank you

    1. Hi Monica!

      Sorry for the delayed answer, but i was on internet and phonefree holiday 🙂
      Do i understand that correctly, that you want to add another directory to add the watermark?

      you already have http://www.example.com/wp-content/uploads done with watermarks, so if you want to have http://www.example.com/tryme to have the watermark, you have to add this line to your .htaccess file:

      RewriteRule ^(.*)tryme/(.*) $1watermark.php?src=tryme/$2

      now you are all set!

      cheers

      fischi

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert