5 June 2013
Category:
Blog
Comments: Comments Off on Get a Link Back to Your WordPress Site from Copy & Pasted Text

Get a Link Back to Your WordPress Site from Copy & Pasted Text

Did you know that copying and pasting makes up 82% of all content sharing on the web — 4.5 times more than social sharing buttons?

That’s what advertising giant 33across/Tynt found in a study done at the end of last year.

You may find that interesting. But so what? How can you use that information for your own site? Read on to find out.

Get a Link Back from Copy & Pasted Text

Have you ever copied a piece of text from a website into an email, a file, a forum, or even onto your own site, and suddenly you notice that appended to the end of the text was a link back to the page where it came from?

Pretty cool, right? And when you think about it, pretty good for SEO purposes too. Well, that’s what this little piece of code below will let you achieve for your own site.

If you paste this in as is, it will show a link back to the page with the following style. Let’s say your post is titled “Little Orange Squares” and your site is mysite.com.

Read more: Little Orange Squares http://mysite.com/little-orange-squares/

You can change this to say something like “Read more at MySite” by just adding what you’d like at the end of the “Read more” text.

Paste the following into your functions.php file (Appearance > Editor > Theme Functions – functions.php).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function add_copyright_text() {
    if (is_single()) { ?>




}
}

add_action( 'wp_head', 'add_copyright_text');

If you are using a link shortening service, then you can use the code above with it, but replace get_permalink with wp_get_shortlink.

If you would like to make your own simple plugin for this code, you can learn how to do that here.

(Thanks to wpbeginner for this code.)

Photo: Chain Link Close Up from BigStock

Related posts:

  1. WP-ShowHide: Embed Text Within Your Posts With A Show/Hide Link If you want to include a block of text within…
  2. WordPress 3.2: Bring Back Your Network Admin Link With Our Free Plugin Network Administrators are going to be a little bit sad…
  3. How to Display a Link to Your Google+ Profile on Your WordPress Site Google+ is still in limited beta but invites have started…

Comments are closed.