Automatic links in WordPress

There are many reasons why you may need to link words or phrases to URLs . Whether to position keywords, or to sell affiliate links, I'm sure you've thought about it more than once.

Of course, you can do it manually, and each time you use a word or phrase, add a link to your URL. Affiliated, or to the destination site, but would not it be better to automate this task? .

Let's see, as always, a couple of simple ways to do it …

1. Automatic links with plugin

There is a wonderful plugin which I admit I use in most of the WordPress that I have. It is called SEO Smart Links and, in addition to providing self-links to its own content, automatically, which I never recommend, has a special section on the settings page, called " custom keywords ] "Where you can make every time that a specific word or phrase appears in the text of your posts, it is auto-linked to the URL that you tell it.

The format would be something like this:

And you can add as many lines as you like.

Here are some boxes where you define how many words (or phrases) linked there will be per entry (default 3), how many times is it linked to one URL per entry (default 1) and how many times is it linked To the same keyword (also by default 1).

To finish you can choose if the link will be "nofollow" or if it will open in a new window.

It works of coña , configure it and run.

2. Automatic links with code

And, as always, you can also do it without installing plugin simply by adding a small piece of code to your function plugin or, if you prefer, to file functions.php of your active theme.

The code will look something like this:

As explained in the same code you just have to make your list of words (or phrases) and what will be replaced. In fact, this code can be used to replace any text with another one or, in this case, texts by a complete HTML, which includes link, linked word, " title " or even if it opens in a new window, that you want, is a chain of pure and simple substitution, that you can adapt to your needs .

Which method is better?

Sincerely I think the SEO plugin is more complete Smart links because it allows to define an important parameter, and is how many times the auto-link will be made, something that you can not do with the code. And it's important because imagine an entry where you use 7 or 8 times the word " wordpress " – as is my case in this blog – and, as you can guess, the code will not discriminate and all the times will appear auto-linked . However, with the plugin you can limit this operation, and not overwhelm with too many links that, by the way, could even be harmful to your SEO.

In short, the option of do this trick with code it would be ideal only for very concrete phrases trying not to use it with words that you use very often.

Anyway, you decide, by options that it is not.

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Convert WordPress to HTML5

If you want to convert your WordPress theme from XHTML to HTML5 let's see step by step how to do it. The advantages of using HTML5 have mostly to do with a more human and easy to read website, for browsers and also for search engines.

In fact, Google will thank you for using the already standard tags HTML5.

In this tutorial we are going to convert the following files:

  • header.php
  • index.php
  • sidebar.php
  • footer.php
  • single.php
  • style. css

These files are the basics of any WordPress theme, the rest you can adapt based on the premises of these, which are the fundamentals.

1. HTML5 Base Template

The basic HTML5 structure is based on tags like header footer nav section and ] article which, in English, are much more self-explanatory than the structure by " div " of XHTML.

A complete example would be this:

One file header.php type would be like this:

If we convert it to HTML5 it looks like this:

The only element maintained in the conversion would be the tag div which you can replace with the new section if you wish.

Another possible change would be that in HTML5 the tags script and link are used. So you can remove type = "text / javascript" Since any browser will consider the tag script as JavaScript unless you specify the type. Also, you can remove type = "text / css" from your label link for the stylesheet.

3. Convert index.php to HTML5

To not put all the code possible, we refer to the basic tags to be modified in a file index.php base, which would be like this:

At this point what there is Note that in HTML5 section replaces div entries that article replaces div posts and that aside ] is what is used for our sidebar.

A complete index.php would be something like this:

A simple sidebar.php of this style:

It happens like this in HTML5:

As you see the important thing is to change the div by aside which identifies it as such.

Again, this is simple, going from something like this:

to this other in HTML5:

6. Convert single.php to HTML5

Here, starting from a file type single.php in XHTML like this:

Y con esto ya tenemos un tema WordPress casi completo en HTML5. A partir de aquí podemos usar las etiquetas HTML5 como hemos visto en los archivos anteriores sobre el resto de los que use tu tema. Por ejemplo, el fichero page.php usará la misma estructura que single.phppara archive.php nos basaremos en index.php y así sucesivamente.

Aquí te dejo unos interesantes enlaces para aprender más sobre HTML5:

Esta guía es una adaptación del tutorial creado por WP tuts

AVISO: esta publicación es de hace dos años o más. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Luego no digas que no te hemos avisado.


Puede que también te ayude:

Use .htaccess as Firewall

# 5G FIREWALL from PerishablePress . com


<IfModule mod _ rewrite . c >

RewriteEngine On

RewriteBase /

RewriteCond% {QUERY_STRING} (environ | localhost | mosconfig | scanner) [NC,OR] [19659006] RewriteCond% {QUERY_STRING} (menu | mod | path | tag) = .? /? [NC,OR]

RewriteCond% {QUERY_STRING} boot .ini [NC,OR]

RewriteCond% {QUERY_STRING} echo. * Kae [NC,OR] [19659006] RewriteCond% {QUERY_STRING} etc / passwd [NC,OR]

RewriteCond% {QUERY_STRING} = \% 27 $ [NC,OR]

RewriteCond% {QUERY_STRING} = \ '$ [NC,OR]

RewriteCond% {QUERY_STRING} . ./ [NC,OR]

RewriteCond% {QUERY_STRING} : [NC,OR]

RewriteCond% {QUERY_STRING} [[NC,OR]

RewriteCond% {QUERY_STRING} ] [NC]

RewriteRule. * – [F]


<IfModule mod _ s etenvif . c >

SetEnvIfNoCase User-Agent ^ $ keep_out

SetEnvIfNoCase User-Agent (casper | cmsworldmap | diavol | dotbot ) Keep_out

SetEnvIfNoCase User-Agent (flicky | ia_archiver | jakarta | kmccrew) keep_out

SetEnvIfNoCase User-Agent (libwww | planetwork | pycurl | skygrid) keep_out ]


Order Allow, Deny

Allow from all

Deny from env = keep_out


<IfModule mod _ alias . c >

RedirectMatch 403 (https? | ftp | php) : //

RedirectMatch 403 / (cgi | https? | ima | ucp) /

RedirectMatch 403 ( = \ '| = \% 27 | / \' /? | ) . Css () $

RedirectMatch 403 (, | // | ) + | / , / | {0 } | ( / ( | ] . . . | + + + | | )

RedirectMatch 403 . (Cgi | asp | aspx | cfg | dll | exe | jsp | mdb | sql | ini | rar) $

RedirectMatch 403 /(contac|fpw|install|pingserver|register).php

RedirectMatch 403 (base64 | crossdomain | localhost | wwwroot)

RedirectMatch 403 (eval ( | _vti _ | ([19659083] null ) | echo. * Kae)

RedirectMatch 403 .well -known / host -meta

RedirectMatch 403 /function.array-rand

RedirectMatch 403 ) ; $ ( this ) []

RedirectMatch 403 proc / self / environ

RedirectMatch 403 msnbot . htm ) . _

RedirectMatch 403 /ref.outcontrol

RedirectMatch 403 com _cropimage

RedirectMatch 403 indonesia .htm

RedirectMatch 403 { $ itemURL }

RedirectMatch 403 function ( )

RedirectMatch 403 labels .rdf

Exclude WordPress RSS feed categories • WordPress Help

Let's say that, for example, you have a website about scientific divulgation but, eventually, you publish your first photos of landscapes in the category " photograph ."

As you can imagine, surely your visitors will be for your scientific articles, not for your photographic progress, so if you subscribe to your RSS feed you probably do not care about your photos (notes Matt ).

Well, if you want to exclude some category from the RSS feed is very easy, you just have to add this code to your function plugin or your file functions.php of active topic:

Where category "-8" is the ID of the category you want to exclude. You save the changes and you already have it.

If you do not dare to use the code you can use the plugin Ultimate Category Excluder which has a settings page in which to check the boxes of the categories to exclude .

Re-publish an old post to improve your ranking • WordPress Help

If you want to position a little bit more an already veteran entry without dizzy Google, attracting more traffic to it with new visits and comments, it's very easy.

Also, you have to install anything, or create or modify code simply do the following:

What you get, without changing the URL, the important permanent link is to appear on the front page, with will attract more traffic inbound links from visitors who share and, possibly, comments, thereby will improve positioning SEO ] of the entry.

For Google purposes it is your same entry which suddenly has more inbound links and traffic, with luck comments (which are content), so will raise you some puntillos de SEO .

Infection in JS and PHP WordPress files with obfuscated Base64 code

I have been investigating a matter for days, a serious infection in Javascript files that generates redirects and, occasionally, warnings Virus alert / Trojans on infected sites

The tricky thing is that the bloody bug hides pretty well and a general review, even a check with the usual WordPress security plugins , they do not detect it. This is because is hidden by obfuscated code Base64 in files with extension .js where it can.

In fact you can be days, weeks or months without knowing if you are infected , unless you check your browser's activity window or someone with an especially sensitive antivirus warns you, like AVAST's paranoia modes, which is how I found out.

One of the first symptoms you can check is, from the Browser activity window (in my case Safari), some call to the IP which doing lookup takes you on trip none other than to the Russian Federation and it's a IP that has already been reported as a source of spam and Trojans what is it getting a little bit?

You can also check it out in the status bar of, for example, Firefox, if you keep thinking trying to connect r with that same IP or a very similar one. I would do it this way:

Note: the domain to which redirects may change

affirmative put yourself to work, and it will not be too much for you to review your WordPres installation.

Note: At this point I want to clarify that it is not an exclusive WordPress infection but that bug can affect any website with Javascript files although for the time being it has settled in insecure installations of our Dear CMS.

The first thing would be to review the files with extension .php and .js of your subject, if in any of them – comparing it with the original files just downloaded – you find lines at the end of more, prepare a coffee that you have for a while. Normally, in PHP files you will find obfuscated code of this style:

In JS something like this:

This damn spawn has the bad habit, too, of creating PHP files, with names and random code ]so in addition you can fill your installation with PHP files running – again – obfuscated code . You can also enter the code in the following files:

  • Empty index.php files in the plugins, themes, wp-content, uploads, upgrade, languages, root folders, etc.
  • File wp-config.php
  • ] Any PHP file found
  • Any JS file found

Ok, I'm already scared, what do I do?!

Well, get to work. The bug this gets everywhere, so there may be infected plugins, themes, even WordPress core files so it's best to heal in health and …

  1. Delete all PHP or JS files that is not from your installation of WordPress or you have uploaded your, and by that I mean all, if you doubt it you delete it … or you check it line by line, yourself.
  2. Upload by FTP a clean version of WordPress, replacing the current files and folders for the new ones
  3. Upload by FTP also a clean version of the file wp-config.php and put your connection data to SQL, as in a new installation
  4. Upload by FTP new versions of ALL your plugins
  5. Upload by FTP a clean version of your active theme (and any other you have)
  6. Change your FTP access password
  7. Change your password to access WordPress

It seems radical but it's not really a very long process and that way you're assured that parts are clean. Juanma, in case you feel like it, offers us a alternative cleaning mode .

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Remove notes of WordPress news

One of the novelties of WordPress 3.3 were the notes of news, worth the redundancy. Those " sandwiches " that come with each new functionality in the updates.

Useful for many users, can be a nuisance for others and, fortunately, if you do not want them to come out these " annoying "notes to each update sometimes irrelevant, you can delete them at the root.

You just have to add the following code to your function plugin (or add the code to the file functions.php of your active theme):

You save the changes and you already have it.

Force the password change every 30 days

If you have a website where security is important, you would surely like to apply the criterion of that users change their password every so often as is required in corporate environments, where the change is forced of keys to avoid the use of easy-to-remember passwords or the negligence of users regarding the security of the site.

If this is your case I recommend you to use Expire user password which automates the obligation of change the password to registered users every 30 days.

There's nothing to configure, you activate it and the countdown starts, just like that.

It also works for multisite installations, which makes perfect sense.

] If you want to change the expiration time of the passwords you should then add to the file wp-config.php a new variable 'DEFINE' called "TMG_AEP_EXPIRY" defining the number of seconds two from which the password change will be requested again.

Analyze the performance of your plugins … with a plugin • WordPress Help

If you have questions about what plugins may be slowing down your WordPress installation in addition to the server tools, which not always designed for humans, you can always analyze the performance and consumption of the plugins installed … with another plugin.

For that precisely was born P3 to analyze your plugins and show you statistics of which ones and how they consume more resources.

Once installed, add a link under the 'Tools' menu of your WordPress Desktop and the first thing you have to do is scan the plugins, before which you can configure settings like your IP or bridge the caches, which will be more effective:

In the previous capture you have the result of a scan with 28 active plugins which shows that the impact of the plugins on site load is 8.2%, which is less than 0.2 seconds of load time per visit, after generating 40 requests (queries) to the database.

Just below this result, P3 offers us a series of graphs in which we can visualize in detail which are the plugins that consume the most even what parts of your WordPress are those that most influence the loading of your website.

In addition, you can keep a history of the scans to see how the installation of a new plugin, or an update of any of them, affects the performance of your site

I found it very complete and interesting, have you tried it?

Note: if for any reason you interrupt a scan of P3 you will not be able to access your admin, not even your WordPress. The way to fix it is to access the plugin folder via FTP and delete the file called .profile-enabled

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: