Mark affiliate links in your content using CSS

As a German blogger, there are some things you should be aware of. One of them is the „Gesetz gegen den unlauteren Wettbewerb“ (law against unfair business practices). If you run a business and you think, that someone is taking advantage by not following some rules, you might be able to sue them. Even if you only have a „personal blog“, chances are very high, that it’s not totally „private“. Some bloggers don’t want to have advertisements on their blog, but they participate in some affiliate programs and „just“ place some links. But this is considered advertisement as well and must therefore be marked as such.


As I am not a lawyer, the text of this blog post may not be completely legally founded. Therefore, this blog post will only give you a technical solution, which might not be enough legally. If you have any doubts, please consult a lawyer, you can verify your specific situation.

When to mark affiliate links

Many bloggers who use some sort of affiliate program do it in a correct way. They clearly mark those links as such or the affiliate placement itself is clearly recognizable as advertisement (like the Host Europe affiliate program ads, I have on this blog). But some might not be easily recognizable. In Germany, any media that gives the impression of neutrality, must clearly mark any links or even whole posts (sponsored posts). A simple note like „some links on my blog might be affiliate links“ is not enough. But how can you mark them? A very simple solution would be adding the text „(advertisement)“ after every such link. But chances are, that a blogger forgets it.

Marking links using CSS

As placing affiliate links and updating their targets is usually not done manually but through plugins, we can utilize that to automate the marking of such links. There are many out there and as I don’t use any of them, let’s take ThirstyAffiliates as an example. They say, that they are an „affiliate link management & link cloaking tool“. And this cloaking does not really work well with the German law, as it’s even harder to recognize an affiliate link from its URL. The plugin is taking the ugly links and convert them to some pretty ones. They might look something like this:

The term „recommends“ in the URL does not really tell the user, that money is involved. And as the plugin has no option to add any marking to the link, we have to find an easy solution. After someone asked me to help him finding one, I came up with the following CSS:

a[href*="/recommends/"]:after {
	content: " (affiliate link)";

As the example plugin is always using the same static word in its URLs, we can simply use this in a CSS selector and then add some additional text after the link text. If this solution will be legally enough for marking a link as an advertisement is a different story. So better ask a founded lawyer about this.


I hope that this blog post could help you a bit to understand, why marking an affiliate link as such, is very important. At least if you do business in Germany (or if you are a „no purely“ personal blog). I would really like to see the plugins to offer an option to mark affiliate links. This will protect the users of their plugin from sues. But maybe the laws in the countries of the plugin programmers are not as strict as in Germany. Then we as a community should ask them to implement such an option.

I do not use any affiliate links on my blog, but I know many of my readers do. And not all of them always mark every link. How about you? Do you use affiliate links? And how do you mark them? Or why not? I would really be interested in your comments.

  • Veröffentlicht in: Misc

Set a default message for the Jetpack Publicize module

Many of you probably share their new blog post on social media platform like Facebook, Google+, Twitter and others. I also do that, but I always post them manually with a nice custom message. But sometimes you need to have a more automated way to post to those platforms. Especially when you publish a lot of content and/or you are sharing on many platforms. Then you might want to use one of the many automatic sharing plugins around.

Social media postings with the Jetpack Publicize module

On a client’s website, we’ve used Jetpack for the sharing. Once you’ve activated the Publicize module and connected to some services, you will with a new setting in the „Publish“ metabox. Clicking the „Edit Details“ link, you will see a new textarea, where you can set the custom message to be used when shared. It looks like this:

A screenshot of the Publish metabox with the Jetpack Publicize default message input

As you can see, the „Custom Message“ is the title of the current blog post. You can change it here manually, but wouldn’t it be nice, if it would be something more meaningful, by default (and in case, you forget to edit it, before publishing)?

Changing the default message

On my search for a simple solution I’ve found some older blog posts. But the method either doesn’t work anymore, or just not in the setup I had. They also changed the value, when the post was saved. Therefore, I would not have been possible to change the text using the metabox anymore. I finally came up with a solution, that changes the text only when creating a new post and no value has yet been saved. The solution is as simple as this little snippet:

function set_jetpack_publicize_default_message() {
	global $post;
	if ( ! empty( $post->ID ) ) {
		if ( ! $wpas_title = get_post_meta( $post->ID, '_wpas_mess', true ) ) {
			/* translators: %s: the name of the blog */
			$custom_message = sprintf(
				__( 'Check out this new awesome blog post on %s!',
				get_bloginfo( 'name' )
			update_post_meta( $post->ID, '_wpas_mess', $custom_message );
add_action( 'post_submitbox_misc_actions', 'set_jetpack_publicize_default_message' );

The function checks, if a sharing default message is already set, and if not, it will set a nicer one for us. But this new message is still editable and as soon as the message was set once, it will not change it again.


A small snippet and your sharing messages will look a lot nicer than before. But for myself, I stay with the method of posting each social media message individually. This way, I can create an optimal 140 characters message for Twitter and a larger one for the other social media profile.

How do you share your blog posts on social media? Do you use Jetpack or another plugin? Do you use any external tool or service? Or do you post them manually on your social media profiles and pages?

Redirect the main site of a WordPress multisite network

Before I start with my first „Project 52“ blog post, I want to apologize to all my English readers for not being version active. If you don’t know German, you didn’t have too much to read on my blog in the past. It was acutaly only one real post in the last 4 years (and three posts with slides from my WordCamp talks) only. But this is going to change now!

For those of you who can read German, you might have read my advent calendar in 2015, followed by #projekt52 (a blog post every week of the year) and another advent calendar in 2016. As I was very unhappy with the fact, that I haven’t blogged in English too much, I’ve made a decision: I will blog every two weeks in English and on every other week, I’ll translate this blog post into German, starting today!

A multisite with no main site

This week, I finished the migration of a large client project into a new multisite installation. This multisite had the goal to have one sub-site per customer of our client. Every multisite needs a main top level domain. For this example, let’s say the name of the domain was The multisite was set up to use subdomains, while working on the draft of a new customer sub-site. So, we would have something like and Once the sites where ready to go live, the sub-site were switched to a domain or subdomain (e.g. and I was using the core WordPress functionality to map those domains and no additional domain mapping plugin.

Weiterlesen →

WordCamp Bilbao 2016 – A WordCamp not like many others

The last two days I attended the first WordCamp in Bilbao, Spain. It was not at all the first WordCamp outside of Germany for me but I still experienced some differences. The first thing was, that I attended only two Sessions. Or at least only two I understood. Because all the other sessions were given in Spanish or Basque, which I both don’t speak 🙂 And that brings me to the first thing I liked about this WordCamp.

A WordCamp truly for the local community

The idea of WordCamps started as something local. We tend to forget this as we attend big ones like WordCamp in London with 600+ and the WordCamp Europe this year with 2200+ attendees. So they are usually very international and it is pretty common that people travel to those WordCamps from all over Europe (or even worldwide).

I had the WordCamp in Bilbao on my list because I wanted to visit a very good friend in this town, while also attending the WordCamp. So as soon as they announced the date, which was not even two months before the WordCamp, I asked if there will be any English talks. Ibon Azkoitia, the lead organizer, reached out to me on Slack and told me that they were planning to have 80% local speakers and 20% foreign. And with „local“ they really meant local speakers, so from Bilbao and around. And this also meant some talks in Basque, the local language, which is just a Spanish dialect but a very own language with no connection to any other language.

He then asked me to give him the title of the talk I was planning to give 🙂 I really didn’t mean to give a talk, I just wanted to visit the WordCamp as well as the city and my friend. But he asked so nicely, how could I have say no? 😉

Weiterlesen →

Slides from my session „Better Themes with Scalable Vector Graphics (SVG)“ at WordCamp Nuremberg 2016

My first WordCamp talk this year about a topic I personally find really important. I hope that you have all learned something new. At least the bit about CSS filters 🙂

Better Themes with SVG

I also added an „Online Image Map Generator“ service to the sources, that looks quite nice. For the Color-Matrix CSS filters, I couldn’t find an easy generator.

UPDATE 11.06.2016: I’ve also givin this talk at WordCamp Bilbao. My slightly modfied slides can also be here: Better Themes with SVG – WordCamp Bilbao 2016.

Slides from my session „A Brief Word on Plugin Initialization“ at WordCamp Berlin 2015

At my seventh and last WordCamp for this year, I was part of the organizing team and not only a regular attendee. But I still found the time to prepare a lightning talk. It was about a topic I see a lot while working on client websites. So here are the slides of the session:

A Brief Word on Plugin Initialization

I had the feeling, that some attendees got the point of my talk. If you know any more modern way to initialize a plugin or if you have any further questions, just leave me a comment.

Slides from my session „Beginner’s Guide to SASS“ at WordCamp Norrköping 2015

Today I was able to held my session about SASS, which I first presented in June at the WordCamp Cologne, in English at the WordCamp Norrköping, Sweden. In this post you can find the slides I used including the sources and links. Feel free to view or download it:

Beginner´s Guide to SASS

If you have any additional questions after my session, just leave me a comment. I would also love to hear your feedback on it.

But now it’s time for the last session followed by a great afterparty and a Contributor Day tomorrow.

UPDATE 12.06.2016: I’ve also givin this talk at the WordCamp Bilbao Contributor Day. My slightly modfied slides can also be here: Beginner’s Guide to SASS – WordCamp Bilbao Contributor Day 2016.

Use WP-Minify and Jetpack together

Like probably the most of you, I use the Jetpack plugin from Automattic. Some time ago I also installed the plugin WP-Minify. This plugin enables you to combine all JavaScript and CSS files from the HEAD into a single file which can also be minified. In doing so you are saving your visitors a lot of requests. Also the total request size will decrease because of the minification. If you haven’t set up some caching headers fpr JavaScript and CSS, the plugin will also do this for you. Unfortunately, there are problems with the simultaneous use of Jetpack and WP-Minify. But the solution is quite simple.

Weiterlesen →

Setup a catchall email account in Plesk

As I mentioned in several other articles this blog running is running on a server with Plesk. For my domain I can currently specify only one e-mail address for the domain at my hoster. But since I wanted to use other addresses I took advantage of the Plesk email function.

Since all email addresses of my domain would be forwarded to a single address anyways, I still wanted find a way in Plesk and finally found it. It’s failry easy to setup a so-called catchall email account. The setting, however, is a bit hidden.

Weiterlesen →

In April still a joke, but now it’s reality!

-In April I wrote about the brilliant April Fool’s joke of It reported that the last IP address was assigned and due to maintenance all DNS root servers must be shut down for 24 hours.

Now it is actually so far. They won’t shut down all dedicated server for 24 hours, but the last IPv4 addresses have been assigned (to be precise, the last five code blocks have been awarded) as you can read on

But what does this mean? Do we all need to panic? No we do not need to. With IPv6 we there has been a successor for a long time, but it hasn’t been fully enforced, yet. Many ISPs still haven’t converted their entire infrastructure.

I am so excited with which April’s Fools joke the media will come up this year, and how long does it take until it is sad reality.


Now the time has come for the 24-hour shutdown, as reported. However only large internet companies like Google, Facebook will test their services for 24 hours on IPv6 infrastructure. We will see whether everything still runs smoothly for IPv4 users. The IPv6 Day is planed for June, 8 2011.

  • Veröffentlicht in: Misc