Send Newsletters Automatically in MailChimp using RSS

Published in WordPress.

WordPress is an open source project with one clear mission: to democratize publishing through Open Source. In other words, it wants us to freely express ourselves, to let the world know what we think. The only problem is, what’s the point of sharing our minds if there’s nobody listening?

The greatest problem you’ll probably face when running a blog is getting a fan base—those people who are always interested in your content, who comment on all your thoughts and share your posts on social media, who like you on Facebook and retweet your tweets… That’s the people you want for your blog, don’t you? So, the question now is how to create a loyal reader base.

Our last posts have talked about this issue from different perspectives. For example, last week Ruth discussed what is the best moment for sharing your content on social media, and a week before that Toni shared some tips and tricks to increase our productivity and be more effective at promoting our content. In the end, it’s all about making some noise and hope for people to discover you exist. While people don’t know you, it’s your job to move your ass and reach them ¯_(ツ)_/¯

One of Toni’s tips was to create a mailing list with your audience, so that you can ping them every now and then, letting them know when there’s new content available in your blog (and thus driving traffic to your web). Usually, this communication is quite effective—you’re emailing people who’s already interested in your content, because they implicitly told you so when they subscribed to the mailing list. That’s what makes them the perfect candidates to become your fans! 🤗 So, today we’ll talk about how you can create a Newsletter in MailChimp that’s automatically sent when there’s new content available in your blog.

What is a Newsletter

A newsletter is a regularly distributed publication (in our case, via email) that is generally about one main topic of interest to its subscribers. If you think that emails are old-fashion and that there are better ways to connect with your audience, you probably need to read Neil Patel‘s article on why email still matters:

Historically, email has been one of the most important channels for driving ROI. (…) Email addresses are the core unit of analysis for identifying customers [and email marketing offers an integrated measurement, for it shows] how much you’re spending and how much revenue you’re generating over the long-term.

» Email Is the Foundation of Everything Online

So there you have it! Emails are pretty important in the long run 😉 But even if you’re not interested right now in getting into all these details, you should know that Newsletters have a great advantage compared to other marketing channels. As opposed to networks like Twitter or Facebook, where everybody follows everybody, newsletters are super targeted and will be received only by people who clearly showed interest in your work. How can you be sure about it? Well, they shared their email address with you, so you can probably assume they are interested in your blog, aren’t they?

What is MailChimp

Now that we’ve established the importance of having a newsletter in place, it’s time to discuss how to create your own. There’s plenty of services for that, but the one that everybody seems to get started with is MailChimp. As one can read in their website:

MailChimp is an email service provider (ESP), which helps marketers send bulk emails to clients, customers, and other interested parties. Our approach to email marketing focuses on excellent list management practices, beautifully designed campaigns, and powerful data analysis.

MailChimp’s biggest advantage lies in its free version. With its starting (free) plan, you’ll get full control of your mailing campaigns and you’ll be able to send up to 2,000 emails at once. Not bad for getting started, huh? 💪

How to Create an Automatic Newsletter in Mailchimp

Sending Newsletters to your subscribers is equivalent to sending them customized emails manually. But, of course, you don’t want to do that—you want to automate as much as possible of this process, and that’s when MailChimp and similar services come into play. With MailChimp, each Newsletter is a new campaign that you can create as follows:

  1. Go to the Campaigns page.
  2. Click on Create campaign and select the type of campaign you want to create. In this case, a regular campaign.
  3. Select the recipients.
  4. On the Setup step, configure some basic information about the email you’re about to send: subject, sender, and so on.
  5. Select the template you want to use.
  6. Write your email copy and make sure it looks good.
  7. Send it! 👏

As you can see, creating email campaigns is quite similar to creating regular emails. So, why should you use MailChimp? Well, imagine you want to send an email each time a new post has been published in your site, or you want to send the email once a week/month with a summary of the newly published posts during that period. Do you really want to repeat the previous process each and every time? 🤔😥 I bet you don’t. And there’s no need to! Don’t you remember I told you this post is about how to create an automatic Newsletter? 😎

Sending Newsletters automatically when new content appears in your WordPress site is super easy with RSS campaigns. For those of you who don’t know what RSS is (shame on you!), here’s Wikipedia’s definition:

RSS (Rich Site Summary; often called Really Simple Syndication) uses a family of standard web feed formats to publish frequently updated information: blog entries, news headlines, audio, video. An RSS document (called “feed”) includes full or summarized text, and metadata, like publishing date and author’s name. RSS feeds enable publishers to syndicate data automatically. A standard XML file format ensures compatibility with many different machines/programs. RSS feeds also benefit users who want to receive timely updates from favorite websites or to aggregate data from many sites.

All WordPress installations include an RSS channel that allows your readers to subscribe to your blog. You can easily access it by appending /feed to your site’s URL. For instance, Nelio Software‘s RSS feed can be found at neliosoftware.com/feed. If you click on the previous link, you’ll see an XML website with a list of all the recently-published posts. This feed is updated automatically each time you publish (or un-publish, for that matter) a post from your blog, which means you simply need to tell MailChimp to watch the feed and send a new Newsletter whenever the feed gets updated.

In order to create an RSS campaign with MailChimp, just apply the following steps (which are pretty similar to the ones we’ve just seen; bold face highlights the different ones):

  1. Go to the Campaigns page.
  2. Click on Create campaign and select the type of campaign you want to create. In this particular case, we’re now interested in creating an RSS campaign. Select the URL of your RSS feed (in our example, it’d be neliosoftware.com/feed), as well as the periodicity in which emails should be sent:
    • daily,
    • weekly or
    • monthly.
  3. Select the recipients.
  4. On the Setup step, configure some basic information about the email you’re about to send: subject, sender, and so on.
  5. Select the template you want to use.
  6. Recover the content* (and preview it to make sure things look like they’re supposed to).
  7. Finally, activate the campaign and wait for it to be automatically sent. 👏

Step 6 is the most complicated one, because you’re not supposed to write the content now—instead, the Newsletter should be composed automatically using the information retrieved from the RSS feed. To instruct MailChimp to do this, you simply need to use MailChimp’s special RSS merge tags. I could try to explain how to use them, but I think it’ll be easier if I just show you an example… so, for example, if you want to send a Newsletter such as the following one:

Nelio Software's Newsletter (Spanish version)
Example of one of our latest newsletter campaigns (in Spanish). This is the email our Spanish-speaking subscribers received a few days ago.

your MailChimp template needs to use the following tags:

Designing your Newsletter in MailChimp
Designing your Newsletter in MailChimp is super easy. Just add the required RSS merge tags and you’re done!

As you can see, the actual content of the Newsletter starts with a block named *|RSSITEMS:|*. This block iterates through all the items in the RSS feed and, for each one, it retrieves its different attributes: title (*|RSSITEM:TITLE|*), author (*|RSSITEM:AUTHOR|*) or content (*|RSSITEM:CONTENT_FULL|*).

I hope this tiny tutorial helps you to connect with your audience whilst you save some time. Please, share your own experience with us. And if you have any questions on how to tweak your feed so that you can adapt your template, just ask! I’ll be happy to help 😁

Featured Image by Andrew Taylor.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...

Top 6 Secrets to Successful Internationalization

Published in WordPress.

Nelson Mandela once said:

If you talk to a man in a language he understands, that goes to his head. If you talk to him in his language, that goes to his heart.

A couple of weeks ago we talked about internationalizing your WordPress website so that you can offer your content in multiple languages. Keep in mind that your website is the first thing most prospects will know about you, so the most intimate you can talk to them, the better. And, as Mandela said, native languages play a key role!

If you’re a WordPress plugin or theme developer, you should consider to translate and internationalize not only your website, but also your plugins and themes. This way, your users will be able to use them in their own language, and your plugin or theme will seamlessly integrate in a Dashboard that’s already in a foreign language. Besides, making your work accessible to everyone by translating it will increase your opportunities, because you’ll be able to attract customers that wouldn’t even consider you if you didn’t offer your plugin or theme in their language.

Unfortunately, this is easier said than done, isn’t it? If you don’t know how to do any of this or if you think it’s too complicated, don’t worry! We have your back 🤗 In this post I’ll share with you the top-6 secrets for translating plugins and themes I wish I had known when I started.

Secret #1. Write Your Code (and Strings) in English

If you’re an English-speaker, then you can skip this step. But if your native language isn’t English and you feel more comfortable writing in other languages than English, then, please, don’t. If you’re creating a new theme or plugin, you should avoid using your own language:

Most developers are used to English. Actually, language constructs and keywords are already in English (think about the keywords function, if, or while), so it just makes sense to stick to this language. If you do so, you’ll make the life of other people easier:

  1. The WordPress ecosystem is, by definition, open-sourced. Plugins and themes are written in PHP and JavaScript. Therefore, people will want and/or will be able to read (and hopefully understand) your code.
  2. Remember we’re talking about internationalizing your plugin or theme—that’s our goal today—and you won’t be the one translating it to most of the languages. It’s easier to find translators from English to another language than any other combination, so don’t limit your options by using different “source” languages.
  3. Internationalization functions (we’ll talk about them in just a few minutes) assume you’ll write your strings in English.

The previous example is written in Catalan—a romance language similar to Spanish, French, and Italian. If you know any of these, you might be able to understand most of the code. But if you don’t, you probably don’t have a clue about what that code is supposed to do. But if it were written in English…

then it’d be so much easier for everybody! 😎

Secret #2. Know Your Tools—Internationalization Functions in WordPress

Plugin and theme internationalization in WordPress uses gettext, an old and respectable piece of software, widely used in the open-source world. As described in the Codex, this is how it works:

  1. Developers wrap translatable strings in special gettext functions.
  2. Special tools parse the source code files and extract the translatable strings into .pot (Portable Objects Template) files.
  3. In the WordPress world, .pot files are often fed to GlotPress, which is a collaboration tool for translators.
  4. Translators translate and the result is a .po file (i.e., a .pot file, but with translations inside).
  5. .po files are compiled to binary .mo files, which give faster access to the strings at run-time.

If you need to remember one thing: translatable strings are parsed from special function calls in the source-code, they are not obtained at run-time.

So, what does it all mean? How does gettext look like? Well, it’s as easy as follows—if you want to make the following snippet translatable:

You need to write it as follows:

Instead of echoing the string directly, we first wrap it within the gettext function  __()one of the multiple functions included in the library. This function simply returns the translated equivalent of input string it’s given. If there isn’t a translation available, the original (English) version is returned. By simply applying this step in all your plugin/theme strings, it’ll be ready for translation.

Once all the strings are wrapped, you need to extract them from your source code and generate a .pot file. In order to do this, you can use a WordPress tool called makepot.php (you can download it from this Subversion repository). Then, from a terminal, you simply need to execute the following statement:

Finally, you simply need to tell WordPress that your plugin is actually translatable, so that it uses the proper translations when required (and available). Just edit your plugin‘s main file (usually, plugin-name/plugin-name.php) so that it looks like this:

Line 15 is the Text Domain, whose value is the second parameter you add in all gettext functions, which usually corresponds to the name of the plugin. Line 16 is the Domain Path—that is, the folder in which WordPress will find your .pot file. Finally, in line 27 we define a simple function named  plugin_name_i18n that’s responsible of actually loading the translations. If any of these three elements was missing, internationalization wouldn’t work.

Secret #3. Write Translatable Strings

Now that you know how to make a string translatable, it’s time to talk about how to guarantee that said string can be properly translated. If you’re an English speaker and you don’t know any other language, pay special attention, because we’ll discuss important stuff!

More than once, I’ve come around snippets like these:

I know it’s a silly example but, believe me, this happens too often. The problem with the previous snippet is that the translator is supposed to translate fragments of the final string (“The”, “user”, “post”, and “has been deleted”) as if they were independent building blocks, and it’s the developer who then concatenates all blocks and builds the actual final string. Sure, this works in English—the resulting sentences make perfect sense:

  • The user has been deleted.
  • The post has been deleted.

But this doesn’t work in all languages. For instance, in Spanish nouns have gender—they’re either masculine or feminine. Articles and adjectives are also declined, and they must agree with the noun they complement. So, the previous two sentences in Spanish should look like this:

  • El usuario ha sido borrado. (masculine)
  • La entrada ha sido borrada. (feminine)

The problem? A translator can only translate the word “The” as either El” or La”, but not both at the same time. And the same applies to the last fragment—it’s either “ha sido borrado” or “ha sido borrada“. As a result, following the previous approach, the translated strings will probably look like this:

  • El usuario ha sido borrado. 👍
  • El entrada ha sido borrado. 😨😱

Another thing that developers usually get wrong is plurals. There’s plenty of ways to internationalize a plural string badly, but I’ll give you just a couple of examples. There’s plenty of developers that use an if/else clause for printing the singular and plural versions of their string:

Others try to be more “concise” and use the same root string, dynamically appending a final “s” when required:

Again, this obviously works in English, but when we try to translate those into other languages… well, things go very, very wrong.

How can you fix this and other issues with your translations? Just follow these three simple rules:

1. Write Full Sentences

Never, ever build a sentence by concatenating fragments. Instead, write the full sentence as many times as needed, make each sentence translatable, and let the translator do their work. Sure, this means slightly more work (there’s more sentences to code and translate), but the final result looks far better. If we followed this simple rule, the previous example we discussed would look like this:

and now their translations in Spanish could look like they’re supposed to:

  • El usuario ha sido borrado. 👏🎉
  • La entrada ha sido borrada. 👏🎉

2. Use Placeholders in Your Sentences

Sometimes, your strings need to contain a variable piece of text. For instance, a welcome text might look like this: “Hello, David” or “Hello, Ruth”. Obviously, you can’t generate all the possible sentences for all the names… so you might think that, in this particular case, concatenating the greeting and the name is the right way to go:

¡Wrong! You can’t do it! Just remember rule #1—write full sentences. In these cases, use printf‘s placeholders to indicate where the variable text should be located:

Now, a Spanish translator can provide the following translation:

  • Hola, %s

so that printf gets the translated string with a placeholder in the right location, ready to be replaced with the actual value.

3. Use Plural Functions

English has one singular form, which you use when there’s only “one” of “something” (“one post”, “one user”, “one page”), and one plural form you use in all other cases (“zero posts”, “three users”, “500 pages”). And, truth is, most languages I know also follow this rule. So, if we apply rules #1 and #2, we can easily create translatable plural strings as follows:

But, again, that’s not how you do it. There are other languages that have multiple plurals, and each version of the plural is used depending on the “amount of things” we’re counting. For instance, in Polish, plik (file) is used as follows:

  • 1 plik
  • 2, 3, 4 pliki
  • 5-21 plików
  • 22-24 pliki
  • 25-31 plików
  • etc.

which means that you can’t create an if/else block considering just one string for “1 element” and another for “n elements”—you need something more powerful. Luckily, gettext also includes a function to overcome this issue::

Using a function named _n(), you can specify the singular and the plural sentence (in English, there’s only two versions, remember?). When this “string” is translated to a different language, the translator will have to offer as many translations as their language requires. That is, Spanish translators only needs to produce two translated strings (“%d fichero” and “%d ficheros”), but a Polish translator needs to produce three (“%d plik”, “%d pliki”, and “%d plików”)

Finally, just one thing that’s worth discussing. If you look at the previous snippet, you’ll see that the variable $count appears twice. The first time it appears, it’s a parameter of gettext‘s _n() function, and it simply “tells” gettext how many elements we have, so that gettext can load the appropriate translation string. The second time it appears it’s a parameter of printf, so that the placeholder %d can be replaced with the actual value.

Secret #4. Use Contexts…

One problem with languages (and especially with English) is polysemous words—that is, a single word might have multiple definitions. For instance, “comment” can be a verb (“My mum always comments on what I’m wearing”) or a noun (“He made negative comments to the press”). But the fact that in English both words look exactly the same doesn’t imply that they also look exactly the same in other languages. How should a translator translate the word? Is it a verb or is it a noun? Clearly, the answer to these questions depends on the context we’re in. Sometimes it’s a noun, sometimes it’s a verb:

As you can see, you can add a third parameter to all gettext functions, making the context explicit. Based on my own experience, there are three types of context that disambiguate most cases:

  1. command. The users asks the computer to perform a certain action. For instance, “Delete post”, “Create user”, and so on.
  2. user. Sometimes, it’s the other way around—the computer tells the user what they are supposed to do. For instance, “Type in a valid e-mail address” or “Please, try again later”.
  3. text. If it’s neither of the previous two, then it’s just a text informing or notifying of something. For example, “There was an error during…”, “Payments are processed by a secure platform”, or “Akismet has protected your site from 6,861 spam comments already”.

I strongly suggest you use contexts throughout all your code. In my opinion, it’s a good practice to explicitly state the intention of a certain string using one of the aforementioned contexts, for they ensure that translators will perfectly understand what the message is and how to translate them. There might be some cases in which none of these three fully capture your intention or the appropriate meaning of a given word/sentence—if that’s the case, use a different context and make sure it serves your needs.

Secret #5. …and Help Translators (as much as you can)

As I just said, contexts help translators do their job. But sometimes, it’s not about the context—the string they’re supposed to translate is just cryptic:

the previous string makes absolutely no sense, so it’s hard to believe that any translator will get it right. Best case scenario? They won’t translate it and leave it as it is. In these cases, just add a small description to the string so that the translator can understand what’s going on. Descriptions are added by inserting a comment with the translators: keyword on it:

Thanks to the previous comment, now we know that the string g:i:sa is a PHP date formatter.

Secret #6. Follow the Rules

Finally, if you want to get involved with translations (either by translating your own plugin to a language you know or contributing to third-party plugins), just go to WordPress.org and join the language team you’re interested in. But before you translate anything, make sure you talk to someone in that community and know how they work. Most translation teams have their own guidelines on how to translate (formal vs informal, verb tenses, specific words, and so on), so you need to be familiar with them and adhere to them.

Remember that all translations are produced and maintained by the community. If we want a coherent and good-looking translation, we all need to follow the same rules—if we don’t, it’ll end up looking quite messy.

Are you interested in translating your plugin or theme? Have you already started? Do you want to contribute and don’t know how? Talk to us in the comments section and we’ll help you!

Featured image by Mark Rasmuson.

PoorNot badGoodGreatExcellent (1 votes, average: 5.00 out of 5)
Loading...

WordPress Multilingual – When, Why, and How

Published in WordPress.

English might be the lingua franca of the world, but it’s only the third language by native speakers, after Mandarin and Spanish. And if you take a closer look at English Proficiency Levels (which analyzes English as a foreign language), you might be surprised to discover that there’s plenty of countries in which English is not that common. Spain, for instance, is reported to have a “moderate proficiency” in English and, compared to European countries, it comes almost at the end (#19 out of 27). This might not seem very important, but it actually is; if you’re thinking about launching a new website or expanding your current web to new markets, you need to know your audience. And this means you’ll probably need to speak their language.

The Importance of Language

One of the first things you need to do when launching a new website is to consider your audience, so that you can address it as they expect you to. Your web has to be designed for your visitors—selling products to women over 40 is completely different to discussing video-games on a blog for teenagers. Getting this right is crucial if you want to succeed. And language plays an important role in this facet.

If you’re interested in selling to the states or UK, addressing your audience in English makes perfect sense. But if you’re thinking about Spain or Latin American countries, you might want to add Spanish into the equation too. But, what if you want to address a bigger market? What if you want to become 100% international? What about Italian, French, or German? Did someone just say Asia?

Canadian Charter of Rights and Freedoms, by Eric Constantineau
Address your audience in their language. Image by Eric Constantineau.

There’s plenty of companies, startups, and freelancers who yearn for international success, and they decide to address multiple markets all at once following one simple strategy—offering their products or services in English only. And, hey, I’m not saying this is a bad idea—as I said in the beginning, English is our lingua franca, right? In fact, that’s exactly what we, the Nelio team, did when we first launched Nelio A/B Testing—a service whose website is only in English.

But then you go back to the statistics I shared before and realize that maybe, just maybe, this strategy is not that clever. Maybe English alone won’t do it for you. Maybe you must address your audience using their language.

Do I Need a Multilingual Site?

And here’s the million dollar question—do you really need a multilingual site? According to what I said, it looks like you do… but it really depends on what you need. A quick search on Google reveals tons of articles presenting several reasons for using one. For instance, this article by Belinda Jara in LinkedIn mentions a few:

  1. You can shift away from English Internet users and “try to acquire users in markets that are currently in their growth stages”.
  2. Your marketing strategy might improve a lot, “having the ability to communicate to a whole new international audience in their own language will undoubtedly yield results”.
  3. It demonstrates “you are thinking about the customer”, that you care about them.
  4. It also builds trust. “For many cultures there is an issue of trust when it comes to buying over the internet, especially if they feel it is in a language they are not fully proficient in. Offering them a language alternative allows the customers to feel secure in the fact they know what they are buying, how and who from”.
  5. It can also be the reason for your beating your competitors, especially if they don’t offer their services in languages other than English.
  6. It shows an “International Nature”.
  7. It helps your SEO, for your website will be indexed in other languages too.

As I said, there’s plenty of reasons for considering a multilingual site. But beware! Don’t fool yourself into thinking that multilingual will give you the extra boost your business or web needs. Clearly, offering a website in multiple languages should help you reach a broader audience, and that’s usually a good idea. But that comes for a price—running a multilingual website entails a lot of work. Just consider this blog as an example—it’s only in two languages (Spanish and English), but translating all our blog posts into both languages takes us several hours per month.

Flags, by Raja Habib
Multilingual sites entail extra work, for you’ll have to manage multiple versions (one per language) of your posts and pages. Image by Raja Habib.

My advise is, don’t use multilingual just “because you can”. Instead, think of your target audience and analyze their habits and needs—if they’re not proficient in English, consider adding their language in your website.

How Do I Add Multilingual Capabilities to my WordPress Site?

Surprisingly, WordPress doesn’t support multilingual installations natively. They’re working hard on bringing the platform into as many languages as possibles (the Polyglots team is doing a fantastic job), and there’s some debate around native multilingual support… but don’t expect it any time soon.

Does this mean you can’t run a multilingual WordPress? Of course you can! WordPress is the fantastic tool it is because of its endless alternatives for doing virtually anything. If you want to run a multilingual site with WordPress, you can—and there’s plenty of ways for doing so. Let’s take a look at the most common!

WordPress Multisite

A few days ago I wrote about what WordPress Multisite is and how you can enable it in your own installation. Basically, “WordPress multisite is a feature that gives you the ability to create a network of sites from one single WordPress. If you need to manage more than one site, a multisite setup might be the solution you need”.

If you think about multilingual sites for a moment, you might realize that they look like multiple different sites, each of which is in its own language. Therefore, it seems possible to use WordPress Multisites for running a multilingual installation, doesn’t it? Using WordPress Multisite, we can create as many different sub-sites as we want, each of which will use its own language. All these sub-sites will share the plugins and themes (which is great, because we probably want all of them to look and behave in exactly the same way or at least similarly).

Again, our website is a good example. Nelio Software is a multisite installation with two sub-sites: one in Spanish and another one in English. Both sites are under the same domain, and they include a widget in the footer for switching from one language to the other. Simple and efficient 😀.

Multilingual Plugins

As always, the WordPress ecosystem solves most of the problems you might encounter via plugins. And multilingual sites are no exception. If you want to run a multilingual site, you simply need to select, install, and configure a multilingual plugin. It’s that simple! The main benefit of multilingual plugins (compared to multisite installations) is translation management:

  • In a multisite, each “language variation” of your site is a completely different sub-site in your “network of blogs“. Sub-sites have their own pages, their own blog posts, their own themes… Sure, some assets might be shared (such as the list of available plugins or themes), but the sites behave as if they’re completely unrelated.
  • In a WordPress site with a multilingual plugin, the content of the site itself becomes “translatable”. That is, the plugin will manage the different translations of your pages, posts, and so on. In other words, there’s a “single” page, post, menu… and the plugin takes care of its translations. This makes it easy for your visitors to switch from one language to the other.

Let’s take a look at the most-well-known multilingual plugins and briefly discuss their pros and cons.

WPML

WPML is one of the oldest multilingual plugins available. With this plugin, you’ll be able to translate everything in your WordPress site. WPML is a premium plugin. The available plans (at the moment of writing this post) are:

  1. Multilingual basic blog for $29, with support and updates during one year.
  2. Multilingual CMS for $79, with support and updates during one year.
  3. A lifetime license for a single payment of $195.

If you need a multilingual site, WPML’s pricing is totally reasonable, especially when considering all the functionalities it includes (even though its competitors are free):

  • You can translate posts, pages, media, categories, tags, menus, widgets, custom post types, custom taxonomies…
  • It’s compatible with a lot of plugins and themes, and they even have a compatibility program to ensure things work as expected.
  • There’s a 30-day money-back guarantee, so you can give it a shot and, if you don’t like the plugin or if it doesn’t fit your needs, you can “return it” and get your money back.
  • Its development team is very active.
  • They even offer a professional translation service, which might come very handy if you need to translate your content to a language you don’t know.

If you want to know how to install and configure WPML in your web, follow WPMayor’s Guide on Creating a Multilingual Website Using WPML. It’s a complete and detailed document that will guide you throughout the whole process, step by step.

Polylang

Polylang is a free plugin available on WordPress.org. At the moment of writing this post, it has over 200,000 active installations and a pretty good rating (there are over 400 5-star votes, and it scores 4.8 out of 5). And for a very good reason—Polylang includes most of the functionalities we can find in WPML completely for free. Not bad, huh?

Some of its features are:

  • You can translate posts, pages, media, categories, tags, menus, widgets, custom post types, custom taxonomies…
  • UI is available in multiple languages.
  • There’s an active development team. Support, however, relies on the community (if you use the free version).
  • There’s also a paid version of Polylang that has more extensions, some extra functionalities and advanced support services.

qTranslate X

Finally, another plugin quite used by the community (100,000 active installations and 220 5-star votes tell you so) is qTranslate X. Some of our customers used it and, therefore, I had the chance to see it in action, so I can tell you it’s easy to use and fast.

The main difference between qTranslate X and the other two is how translations are stored in the database. Let’s see if I can give you a hint on how each plugin works.

In WPML, translated content is stored in a different, new entry. So, if you translate a certain post from English to Spanish, your database will look like this:

  1. Original English Post
    • post_title
      Original Title
    • post_content
      Original content.
  2. Translated Spanish Post
    • post_title
      Título traducido
    • post_content
      Contenido traducido

qTranslate X follows a different approach and stores all the information within the same post, tagging each “translation” appropriately. Thus, for instance, the previous example would look like this:

  1. Single (Original) Post
    • post_title
      [:en]Original Title[:es]Título traducido[:]
    • post_content
      [:en]Original content.[:es]Contenido traducido.[:]

I think it’s a clever solution, but I honestly ignore how well this solution plays with other plugins and themes…

Weglot

Weglot is a freemium plugin available on WordPress.org. Launched last February, it grew from 50+ to 5,000+ active installations (over 150 5-star votes, scoring 4.8 out of 5.0).
The plugin follows a different approach for translating content—it automatically detects all the content and offers a first layer of machine translation, so that you can then edit/improve/replace it with a friendly interface.

Some of its features are:

  • It translates all the contents.
  • 5 min to set it up tops.
  • Compatible with all Themes and Plugins.
  • Dedicated support team.

Tips to Consider Before Going Multilingual

Spend some time looking at the different options available before choosing one or the other. No solution is better than the others—it all depends on which one better suits your needs. Do you need power? Simplicity? Do you feel more comfortable with a certain user interface than the other? Make the choice based on your personal needs—but remember, once you’ve selected one option, it might not be easy to migrate to a different one!

Make sure you backup your database before using any of these plugins—they all change the database deeply, and if things go wrong (or if you don’t like one plugin and want to go back to a previous state), the backup will save you time and problems. If your hosting provider allows you to create staging environments, you can use one for testing purposes too.

Wrapping Up…

There’s plenty of reasons for switching to a multilingual website, but make sure you really need it, or else the extra work will end up killing your website (or you’ll simply abandon de multilingual attempt). If you clearly identify that your target audience speaks another language other than English, and believe that adding that language to your website might increase your website’s performance, don’t hesitate and go for it! Remember WordPress doesn’t support multilingual sites natively, but there are different alternatives for you to choose. Study them all, try them all out, and choose the one that better suits your needs.

If you already have a multilingual WordPress, why don’t you share your experience with us? How did you implemented it? Is it worth it?

Featured Image by Karen Roe.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...

How to Upload Additional File Types in WordPress

Published in WordPress.

Being able to manage all the files we upload in WordPress in one place (the media library) is something very useful. Some say the media library could be improved—some requested features are still missing, like file tagging, sorting by topic or by file extension, or searching for duplicates—, but its usefulness is clear when reusing or sharing files between our contents without having to upload them more than once.

Maybe you didn’t know that, but WordPress only allows file uploading into the media library if such files meet certain conditions. Specifically, you can only upload the following file types by default in a standard WordPress installation:

  • Images
    • .jpg
    • .jpeg
    • .png
    • .gif
    • .ico
  • Documents
    • .pdf (Portable Document Format; Adobe Acrobat)
    • .doc, .docx (Microsoft Word Document)
    • .ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation)
    • .odt (OpenDocument Text Document)
    • .xls, .xlsx (Microsoft Excel Document)
    • .psd (Adobe Photoshop Document)
  • Audio
    • .mp3
    • .m4a
    • .ogg
    • .wav
  • Video
    • .mp4, .m4v (MPEG-4)
    • .mov (QuickTime)
    • .wmv (Windows Media Video)
    • .avi
    • .mpg
    • .ogv (Ogg)
    • .3gp (3GPP)
    • .3g2 (3GPP2)

However, it’s not always possible to upload all these file types—some hosting providers limit the set of valid file types and even the maximum file size you can upload in your installation. If you have problems uploading some permitted file types, contact your provider first to get an explanation.

When trying to upload a .SVG image in WordPress you get an error.
When trying to upload a .SVG image in WordPress you get an error.

Recently we received a comment asking us how to expand the list by adding more file types. As surely there are more people interested in learning how to do this, in this post I explain the solution.

Modiying wp-config.php

If you do not want to limit the file types and thus upload any file into the media library, the easiest way to follow is to add the following line in the wp-config.php file:

define( 'ALLOW_UNFILTERED_UPLOADS', true );

The wp-config.php file allows us to modify the default behavior of WordPress. You’ll find it in the root of your server. Using the above statement we are allowing all administrators to upload any file type. Note that this can be dangerous if you do not trust too much your administrators and what they can do. Be careful when adding this statement or you might end up regretting your decision 🙃

Using the upload_mimes filter

If you want to solve the problem of uploading additional file types to WordPress, but being selective and only allowing a controlled subset of file types, the best you can do is use the upload_mimes filter. As always, you have all the information in the Codex.

This filter is super easy to use. You only need to add a piece of code similar to the following in the functions.php file of your theme or inside a new plugin of your own:

You can ignore the first line (<?php), which simply opens a block of PHP code. Line 2 indicates that the function my_mime_types will be executed with the upload_mimes filter. Lines 3 to 10 define this function. my_mime_types has one single parameter ($mime_types)—the list of allowed file types.

If you want to allow SVG and JSON files in the media library, just add lines 4 and 5, respectively. This is how it works: to add a new file type, you just have to create a new entry in the $mime_types list with the file extension and mime type. To find the proper mime type of an extension go to the official list of media types that the IANA (Internet Assigned Numbers Authority) defines.

On the other hand, you can also disable certain file types. You can prohibit the file types you want by simply unsetting their entries in the $mime_types array, as I did in lines 7 and 8, where I disabled Microsoft Excel file uploading.

Summary

As you can see here, modifying the default behavior of WordPress to have greater control over the file types you allow in your installation is very simple. And best of all, you don’t need to install a complex plugin for this. With just a few lines of PHP code or even editing the wp-config.php file you’ll get what you want.

Now it’s your turn. Explain us which file types you miss in WordPress and your experience using the solutions I have proposed in this article.

Featured image by Andrew Pons.

PoorNot badGoodGreatExcellent (12 votes, average: 3.33 out of 5)
Loading...

Free Resources to Learn WordPress

Published in WordPress.

There are great websites that will help you to build a professional-looking WordPress blog from the ground up without having to spend plenty of money and years learning code. A good starting point for learning WordPress is to use the resources offered on the official WordPress site with lessons going over all the basics. However, if you need more information, like to watch video tutorials or to look at more visual information, below I would like to share some other websites where you can learn WordPress to become a Pro.

WPBeginner’s Guide for WordPress

WPBeginner offers a list of free resources with several types of content – written articles, videos, guides, and a useful glossary. If you are a beginner, this is a good starting point and the only requirement to access to all the information is to signup with your email address.

WPBeginner videos
List of WPBeginner videos

Udemy WordPress Courses

Udemy WordPress Free Courses
Screenshot of Udemy WordPress Free Courses

Udemy is is an online learning and teaching platform with over 40,000 courses. There are more than 80 free courses and 470 paid courses of WordPress. Even though the only quality control of the courses is the reviews from users, you can find a good teacher that suits your style.

SiteGround WordPress Tutorials

SiteGround WordPress Tutorials
SiteGround WordPress Tutorials

SiteGround, a well known hosting company, offers 12 detailed video guides to learn how to install WordPress and start working with it.

WordPress.tv by Autommattic

Screen Shot WordPress.tv
Screenshot of WordPress.tv

On WordPress.tv all talks from WordCamps (conferences that focus on everything WordPress where everyone can attend, from a casual user to core developers) and other relevant information (such as introductions to new WordPress version) are posted. So, if you couldn’t attend a WordCamp but want to be updated with the latest news about WordPress, you can reference them here later.

Tyler Moore Videos

Screenshot of Tyler Moore website
Screenshot of Tyler Moore website

Tyler Moore includes 27 free videos to create a website in WordPress starting from scratch. His videos in YouTube about WordPress are among those with more views.

Let’s Build WP videos

Let's Buillt WP video screenshot
Let’s Buillt WP video screenshot

Martie Dread provides simple-to-understand videos to learn how to create a website from scratch. He covers all the steps to create a fully functional website in less than an hour. Martie also publishes his courses in Udemy.

First Site Guide Video library

First Site Guide Video Library screenshot
Some videos listed on First Site Guide video library

On First Site Guide video library, you will find more than 40 short easy-to-follow video tutorials you need to set up and maintain a blog. Topics covered include WordPress, blogging basics, and niche blogging.

YouTube videos

YouTube videos
YouTube videos

YouTube is a great source of WordPress videos including most of the ones mentioned above you cannot avoid. Surely, you can become an WordPress Pro with all the information provided there.

Finally, there are also very useful formal and paid WordPress training programs for intermediate and advanced WordPress users, some of them at just $6 per month or $3 per course (Pippin’s Plugins, Envato Tuts+WordPress, KnowTheCode.io, Lynda.com, OSTraining.com, among others). Do not discard any material just because it’s not free. 😏

And, what’s more important, keep always updated with posts of the greatest WordPress blogs: TorqueMag, WP Smashing Magazine, WP TavernWP Beginner, WPKube, WPMU Dev, WPliftManageWPWP MayorYoast, Chris Lema, Tom McFarlin, and ours 😊.

Featured image by Delfi de la Rua.

PoorNot badGoodGreatExcellent (1 votes, average: 5.00 out of 5)
Loading...

10 Tricks to Write the Perfect Title

Published in Online Marketing.

Translated by Núria Adell.

The title of an article should be its most attractive part since it’s the first thing your visitors see. If it interests them or captures their curiosity, they will click on the article and read it. If your titles are monotonous or they don’t provide anything interesting, you will lose possible readers.

How long do you take to choose the title of your posts? Are you satisfied with the results you achieve? Would you like to be more original? It’s clear that nowadays standing out amongst the rest isn’t easy. Especially if we try to avoid falling into cheap sensationalism or using clickbaits that will damage our image in the long run.

There’s a lot at stake in your titles. This is why I’m going to explain a few tricks that you can use to make the most out of your titles in order to get more readers.

1. Include keywords

Titles play a very important role in the article’s SEO ranking. For this reason we must include the most relevant keywords of our article in the title, as well as those that people usually use to find this type of content or topics.

Have a look at Google Trends and Adwords to know what keywords your target audience uses. You can even search for related topics on Google (or your favorite search engine) to see similar results to our content and the titles that are used. This can help you as inspiration if you can’t find any ideas.

Once you are clear on the keywords, it’s important you use a couple on your title so that your content is indexed and well positioned; like this people will be able to find it easily.

2. Be brief

Don’t use excessively large titles. The longer a title is, the more confusing it is both for Google and your visitors to understand what the article is about.

Google search result showing the complete title of one of our posts. It is a short title which includes relevant keywords.
Google search result showing the complete title of one of our posts. It is a short title which includes relevant keywords.

Try to make your titles no longer than 60 characters. This way your whole title will appear on the results of the Google search. As we say in Spanish: what’s good, if brief, is twice as good.

3. Use lists

Lists work. In fact, they are one of the most used resources since they are very efficient in catching the reader’s attention. In addition, indicating in the title how many elements or points you will consider encourages your visitors to access the content; they like to know how long you’re going to keep them entertained.

9 Must-Read Books To Become A Better Optimizer150+ Marketing Resources You Should Collect or 20+ WordPress Plugins with 1+ Million Active Installs are examples of other posts you can find on our website that have a list as title.

Furthermore, as you will have noticed, in this article I have also used this resource. It’s quite easy to write an article in which you group several concepts under a same context and explain each of them from a different point of view. It also makes it easier to get people to share it on social media if the content is worth it.

4. Generate controversy

Sometimes addressing a controversial topic or one that can provoke a reaction in your audience can be very interesting. If everyone is talking about the good things of the new version of WordPress, you can write a post highlighting the negative side of it (things that are missing, petitions from the community that aren’t covered, etc.)

At Nelio, we have occasionally addressed some controversial topics. For instance, Five Lessons learned after several WordPress paid product reviews is a post in which we explain our negative experience in promoting our own plugins through paid reviews in external websites. We’ve also written the post When WordPress’ Freedom Kills Your Business, which is one of the most popular ones on social networks.

In any case, try not to fall into sensationalism when dealing with controversial topics. That is, don’t manipulate the information or the readers. Yes, you will probably get more visits, but your image will plummet. And recovering from this can be very costly.

5. Solve a problem

It’s quite usual nowadays to find titles referring to tutorials or explaining how to solve some type of problem. The key here is finding a difficulty your audience is having and showing them how to overcome it.

In the article How to Use an Image URL to set the Featured Image we solved the problem of using external images (through a URL) as featured images for the posts. As you can see, it’s one of the most commented posts.

Other examples of titles that try to solve problems are the following:

6. Reveal a secret

By nature, human beings are curious. And your readers are delighted to read something that most people don’t know. Explaining concepts that are unknown is very useful to make your visitors read the full post. Check out the following titles:

  • What no one will tell you about the WordPress plugins
  • 10 things your hosting provider doesn’t want you to know
  • The key of Automattic’s success
  • The best kept secret of online marketing

I’m sure if these titles existed you’d rush to read the full articles. But watch out, be careful not to disappoint your readers. You are creating an expectation that you must meet with your content. If it goes wrong, you’ll lose your audience’s trust.

7. Explain a case of success or failure

Highlighting problems or showing solutions is good, but what people like the most is seeing real cases. The truth sells, and this is why content on events that have happened (to you or a third person) will have a greater impact.

And it’s even more interesting to explain something you’ve done wrong and what you have learnt from it. This is very appealing and incredibly attractive to mobilize your audience.

8. Challenge the reader

Another option that’s worth trying consists in getting the attention of the reader and gaining their curiosity through a defiant question. Suggest a challenge in the title that motivates them to read the rest of the content. Let’s look at some examples:

  • Do you have what’s needed to set up an online shop with WooCommerce?
  • Are you ready to increase the traffic to your website without using ads?
  • Are you capable of improving your content? Accept the challenge with Nelio Content.
  • Do you dare to publish a new post per day? Your challenge of the month.

As you can see, these titles get you hooked on the articles. And if we promote them on our social networks we can manage to expand our audience. With a bit of luck some of these titles will even become viral.

9. Allude to a specific target audience

In this case we try to focus the attention of the title on an objective public. The action of the title falls into a specific group we mention. Let’s look at some examples:

By doing this, you are making your visitors feel reflected in the title since it describes an action or problem that they have with a third person. It is not easy to achieve a title like this, but if you manage, you’ll get good results.

10. Review it after finishing your post

Once you have finished writing a post in WordPress, review the title you have chosen one more time. It might be possible that while writing you have diverted from the original topic or have gone more into detail in some specific aspects and now the title doesn’t fit as well.

Don’t worry, it’s happened to all of us and it’s something very usual. If this is your case, you’re still on time to modify the title so that it fits much better. Take your time, read the content again, and try to rewrite your title.

On top of this, you should ask yourself a few questions before accepting the title as valid:

  • Is it easy to understand what the post is about?
  • Does it incentivize you to read it?
  • Would you share it on social networks?

If the answers to these questions are mainly positive, you’ve got it. You can approve it and be satisfied with the job done. And most importantly, don’t obsess too much. Simply try and learn.

Conclusion

Writing a good title is certainly an artRemember to give your titles the importance they deserve and the results won’t take long to appear.

There are plenty of formulas to achieve attractive titles that capture the reader’s attention and incentivize them to carry on reading. The ones I have described are some of the most used and effective you will find. If your website uses other tricks or techniques, don’t hesitate to share them in the comments. We will be delighted to read about your experiences.

Featured image by Dan Carlson.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...

When WordPress’ Freedom Kills Your Business

Published in Inside Nelio.

Last week one of our customers opened a support ticket describing a weird issue—when he tried to use our plugin, its UI was broken, rendering it completely unusable. Since I’m the one who usually takes care of incoming issues, I’m quite familiar with the problems our customers face… but this was the first time I heard about “a broken UI that makes our plugin unusable” 🤔 Indeed, a weird issue.

Just so you know, this is how our plugin’s supposed to look like:

Screenshot of Nelio Content's Dialog for Adding new Social Messages
Screenshot of Nelio Content’s Dialog for adding new social messages.

and this is what he was seeing in his WordPress:

Broken Dialog because of a Third-Party Plugin
Nelio Content’s Dialog is rendered completely unusable because of an incompatibility issue with a third-party plugin.

😨😱 What the heck?! Our customer was completely right—our plugin can’t be used at all! Just look at the previous screenshot: the editor’s toolbar is over the dialog, the dialog’s layout is completely off, the look and feel is changed (who added this orange bar?)…

Reproducing the Issue

Whenever a user reports an issue, the first thing you need to do is (try to) reproduce it in your development environment. Sometimes reproducing an issue can be very complicated (for instance, they may involve AJAX calls on slow Internet connections). At other times, it’s as easy as activating a setting or installing a third-party plugin. Users will usually offer some information about the circumstances in which they encountered the problem, so that you can reproduce it yourself—if they don’t, ask them for more information until you do.

In this particular case, the issue was super easy to reproduce—I simply had to activate another plugin (Facebook Instant Articles & Google AMP Pages by PageFrog)  in my local environment. For those who don’t know anything about PageFrog:

The PageFrog plugin allows you to easily publish and manage your content directly from WordPress to Facebook Instant Articles (FBIA) and Google Accelerated Mobile Pages (AMP) with full support for ads and analytics.

In principle, there’s no reason for our plugin being incompatible with PageFrog’s. So, why do things go wrong when both plugins are active?

Determining the Source

At this point we’ve already confirmed that an issue exists and we’ve been able to reproduce it locally 💪. So far, so good. Now we need to know why this occurs and find a solution. Unfortunately, there are no guidelines or tips I can give you to help you solve these issues—you’ll have to rely on your experience.

In this case, my gut told me the problem was clearly related to the CSS rules that were applied to Nelio Content‘s dialog, which somehow were overwritten by PageFrog (or something like that). Remember how we reproduced the issue:

  • If PageFrog isn’t active, our dialog looks beautiful.
  • If PageFrog is active, our dialog gets broken.

so the problem must be introduced by PageFrog, and it’s probably related to its CSS rules.

In order to validate this hypothesis, I simply inspected some HTML elements in my dialog using Chrome’s Web Developer Tools and looked for a rule added by PageFrog. For instance, when I inspected the textarea for writing the social message, this is what I saw:

Screenshot of CSS rules applied to one element in a Nelio Content's dialog
Screenshot of the CSS rules applied to one element in a Nelio Content‘s dialog.

Remember that Chrome sorts the rules from more concrete to more generic. See the rules at the bottom (that is, the “most generic” rules) of the previous screenshot? These ones:

They are inserted by a script named pagefrog-admin.css. Is it possible that these rules are the ones responsible of breaking the look and feel of our plugin? There’s only one way to tell—let’s deactivate them and see what happens. You can easily deactivate the rules in Chrome’s Developer Tools:

Deactivating CSS rules in Chrome's Web Developer Tools
You can easily activate, deactivate, edit, add, or remove CSS rules in Chrome using its Web Developer Tools.

And this is the result:

Partially Broken Dialog because of a Third-Party Plugin
After deactivating some CSS rules added by PageFrog, Nelio Content‘s Dialog is finally usable. There are still a few issues to address, though.

Not bad! Now Nelio Content‘s dialog looks “quite good”—its layout is no longer broken and a user can use it. However, we haven’t fixed the issue completely:

  • TinyMCE’s toolbar is still over the dialog (even though it should be below it).
  • The black overlay that darkens the background when a dialog is open isn’t over the Dashboard menu.
  • The look and feel of the dialog itself (not its content) doesn’t match the look and feel of WordPress. Its colors look different, the style of the bar is different, the buttons are different…

Clearly, there’s a lot of “weird things” going on in this dialog. If you don’t know it, let me tell you that these dialogs (and other WordPress UI Components) are powered by jQuery’s UI library, whose dialogs by default look like this:

Default look and feel of a jQuery UI Dialog
Screenshot of jQuery UI page, where you can see the default look and feel of a dialog.

Look at the title bar, the close button, or the rounded corners, and compare them to their counterparts in Nelio Content‘s broken dialog (the one modified by PageFrog’s plugin). They look very similar, don’t they? Sure, Nelio Content‘s has a few differences (for instance, the title bar is orange instead of grey), but still, the resemblance is surprising. What’s going on here? 🤔

Again, you’ll have to hypothesise a possible explanation based on your gut and experience. In this particular case, I thought that, maybe, the developers at PageFrog were adding their own jQuery UI styles, overwriting WordPress‘ defaults. A quick scan of the HTML source code confirmed this hypothesis (look at line 45):

PageFrog adds its own copy of jQuery UI
Screenshot of the HTML source code. In the head section, you can see that jQuery UI libraries are added twice.

The offending script is identified by jquery_ui-css. If the script was enqueued using WordPress default functions, we should be able to find in the plugin‘s source code a snippet where a script named jquery_ui is being registered and/or enqueued. Guess what? We found it in admin/class-pagefrog-admin.php:

PageFrog registers and enqueues its own jQuery UI style
PageFrog registers and enqueues its own jQuery UI style.

If we comment out this custom script, the custom appearance disappears and our dialog looks beautiful again.

When WordPress’ Freedom Kills Saves Your Business

After discovering what caused the issue at hand, I couldn’t help but think that WordPress‘ Freedom was somehow killing our business. These were the facts:

  1. One of our customers was about to leave us because our plugin wasn’t working.
  2. After confirming the issue and being able to reproduce it, I detected that the issue was generated by a third-party plugin.
  3. I had to dive into this plugin‘s code to find out what was amiss and propose a solution, spending some of my time “working for somebody else”.
  4. The problem occurred because WordPress doesn’t have any limits whatsoever on the scripts and rules you add (and overwrite), allowing one plugin to mess with the behaviour and appearance of another plugin.

So it was clear to me: when developers are free to do whatever they want, they (we) will end up messing with other people’s code. We don’t mean any harm, of course, but the end result is the same—we screwed you.

But it turns out, WordPress‘ freedom (and its developers’) doesn’t kill your business—it’s exactly the opposite. Because of WordPress being open source, I was able to explore the source code of the plugin causing an incompatibility issue and find a solution for it. I was able to contact the developers and ask them for a fix. And if they aren’t able to produce it, I’m free to implement this solution all by myself and make sure that our customers can use both plugins safely. Just as Yoast did, for example.

The Solution

Now, don’t get me wrong. I still think that we developers should be more careful when it comes to writing code. Knowing how WordPress and the web work, we must be tidy and responsible. For example, if you add your custom admin pages in the Dashboard, enqueue your own styles and scripts on those pages only, not on every other page.

The issue I described today occurred because two different plugins (Nelio Content and PageFrog) were both modifying the same page: the post editor screen. Each plugin needs its own scripts and styles, so it’s always possible that one plugin overwrites the other unintentionally. They key here is that every plugin should use its own scope.

PageFrog can easily fix the issues we identified. On the one hand, its developers should change the generic CSS rules with a more specific rule set. For example:

On the other hand, they shouldn’t add jQuery UI’s stylesheet and overwrite WordPress‘ default styles. Again, they should probably modify that stylesheet so that it only applies to jQuery components generated by their own plugin.

We’re an open source community. We’re here to help each other and to learn from each other. I contacted the developers at PageFrog a couple of days before this post was published, and at that time I was still waiting for their response. I hope they’ll help us overcome this issue. And if they can’t, I’m not worried, for I know how to fix it 😆

And you, have you ever encountered an issue like this in your own plugins? Or, alternatively, has one of your plugins caused trouble to somebody else’s work? Share your thoughts on this topic!

Featured image by Pabak Sarkar.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...

Creating and Managing WordPress Multisites

Published in WordPress.

Back in 2010 WordPress introduced the multisite feature—that is, the ability to create a network of sites using a single WordPress installation. With it, you can create new sites instantly, manage them all using a single username and password, and you only have to update WordPress, or the themes and plugins your websites use, once (which, believe me, will save you a lot of time).

In this post I’d like to briefly discuss the pros and cons of WordPress multisites and teach you how to activate this feature in a fresh WordPress installation. So, without further ado, let’s get started!

What is WordPress Multisite?

As I just introduced a few lines above, WordPress multisite is a feature that gives you the ability to create a network of sites from one single WordPress. If you need to manage more than one site, a multisite setup might be the solution you need.

Pros of using WordPress Multisite

There are plenty of reasons for using a multisite installation:

  • As the network administrator, you’ll be able to manage multiple sites from one single Dashboard. No need to use third-party tools—this is pure WordPress!
  • You can install themes and plugins once, and all the sites in your network will be able to use them.
  • Updating stuff is also super easy. You can update WordPress, your plugins, and your theme all at once and all the sites in your network will run the newest versions available.
  • Users can be shared across different sites. This way, you don’t need to create users for two, three, or more websites; you can assign a user to as many sites as you want. And, what’s better, the same user can have different roles on different sites! So, in one site he might be a site administrator, in another site he might be a regular contributor.
  • You can allow users to create their own sites in the network (similar to what WordPress.com does).

Cons of using WordPress Multisite

All that glitters is not gold, though. There are some things you should also take into account if you’re starting to think of running a multisite installation:

  • All sites share the same resources, so if one site goes down, they all go down.
  • In other words, if one site gets hacked, all the sites in your network get hacked (remember that WordPress‘ core files, as well as your plugins‘ and themes’, are all shared by the sites in your network).
  • There are some plugins that don’t play well with multisites.
  • In principle, sites can only be located at one single directory or on subdomains of your main domain. That is, if your WordPress multisite is set at https://acme.com and you want to create a subsite for a certain product, you can use the following URLs: https://acme.com/product and https://product.acme.com, but you can‘t even use a completely different domain such as https://acmeproduct.com.
  • Managing a server that can run a multisite installation is not easy, especially if your sites get a lot of traffic.

Do I Need a Multisite Network?

If you’re interested in running multiple sites at once, WordPress Multisite is one possible solution for doing so. But it’s not the only one. Services like ManageWP allow you to manage multiple (single) sites from one single location, saving you time in a way similar to what WordPress Multisite does.

In the end, using one solution or the other really depends on your particular needs and what you feel more comfortable with. But, as a general rule of thumb, I’d consider using WordPress Multisite in the following scenarios:

  • If you’re interested in running a multi-language site, you can use WordPress Multisite to create a different site for each language. This is what we did with our blog 😇😉
  • A business site in which each product or service it offers has to be “separated” from the rest.
  • A magazine with different sections, probably managed by different teams.
  • Schools and academies that want their students to create their own blogs on school servers.

How to Install and Configure WordPress Multisite

Before we start, let me warn you: in this tutorial I’m assuming you start with a fresh WordPress install. If you aren’t and you want to convert an already-existing WordPress installation into a WordPress Multisite, you can do it, but I recommend you to backup your database and your WordPress files first—if things go wrong, it’ll help you revert your changes and either abort the attempt or start all over again.

First of all, you need to edit wp-config.php. You’ll find this file in the root directory of your (fresh 😉) installation. Open the file and look for the following line:

/* That’s all, stop editing! Happy blogging. */

Once you’ve found it, add the following statement right before it:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

/* That’s all, stop editing! Happy blogging. */

so that WordPress knows you want to use it as a Multisite. If you’ve done it correctly, you’ll see there’s a new option named Network Setup in your Dashboard » Tools menu:

WordPress Multisite - Network Setup
After you enabled WordPress Multisite in wp-config.php, you’ll have a new option in your Dashboard to actually install WordPress Multisite.

Click on this option and get ready to setup your “Network of WordPress Sites”. As you can see in the following screenshot, you simply need to decide which URL format will be used by the sites in your WordPress Multisite (as we said before, it’s either a sub-domain https://site1.example.com or a sub-directory https://example.com/site1). You’ll also be asked to set a Network Title that identifies everything and the e-mail of the network administrator.

WordPress Multisite - Installation
The process for installing a WordPress Multisite is quite easy. Just select the link structure and fill the required fields.

Once all the required fields are set, just click on Install and WordPress will adapt its database, so that it can allocate multiple sites. But stay with me! We’re not over yet 🙃 There’s one last step you must complete. After the installation process is over, WordPress will ask you to edit wp-config.php a little bit more, as well as your .htaccess file.

How to Enable WordPress Multisite
During the installation process, WordPress requires you to edit a few files in your server. Follow the instructions as depicted in the previous site.

There’s a couple of things you should be aware of, though:

  • WordPress wants you to add a few lines in wp-config.php. Notice the first line (which defines a constant named MULTISITE) in the suggested snippet is the one we added when we started the process; don’t add it again (it’s already there 😅)
  • You have to replace all WordPress rules in your .htaccess file. That is, you’re not supposed to “append” the new lines, but replace old ones with these.

If you followed the instructions carefully, you’re done! 👍

Configure Network Settings

After you’ve activated WordPress Multisite successfully, your setup looks like this:

  1. There’s your regular WordPress site: https://example.com
  2. And its Dashboard: https://example.com/wp-admin/
  3. But now, there’s also a Network Dashboard: https://example.com/wp-admin/network/

You already know how 1 and 2 look like, so why don’t you go ahead and take a look at your Network Dashboard? This is how it looks like:

WordPress Multisite Dashboard
Screenshot of the WordPress Multisite Dashboard.

It looks like a regular WordPress, doesn’t it? Great! There’s no need to learn yet another tool 😆

There are a few differences you should notice, though. On the one hand, the admin bar has now a new option that lets you jump from one site in your network to another quickly and effortlessly. You can see it in the following screenshot:

WordPress Multisite - Admin Bar Menu
Your Dashboards will now include a new menu option in the admin bar to switch from one WordPress to another, as well as to access the network admin quickly.

On the other hand, the menu included in this Dashboard is a “simplified” version of a regular WordPress Dashboard—it only includes the items related to admin tasks, such as plugin or theme management, and there’s nothing about posts or pages.

Another page that’s completely different from what you’re used to is the Settings screen. Among network settings, you’ll encounter the e-mails that are sent to the administrators of newly-created sites, how to populate them by default, and so on. In my opinion, though, the most interesting setting is found under the Registration Settings section:

WordPress Multisite - Registration Settings
WordPress Multisite’s Settings includes an option for determining who can create new sites and users in your Multisite setup.

As depicted in the screenshot above, you have full control on who can register to your network and who can create new sites:

  • Registration is disabled. Only network admins can add new users and/or new sites.
  • User accounts may be registered. Visitors can create (subscriber) accounts in your sites.
  • Logged in users may register new sites. Any logged user (that is, including subscribers) can create new sites in your network.
  • Both sites and user accounts can be registered. New users can subscribe and create new sites, all at the same time.

How to Manage WordPress Multisite

Managing a WordPress Multisite is not very different from managing a regular WordPress installation. Basically, you’ll have to take care of updating WordPress to its latest version, as well as any plugins or themes that you might have installed. On the other hand, you’ll also be able to manage (that is, add, edit, and remove) sites in your network.

Let’s take a look at the most common operations and some of the differences you might encounter when managing a network compared to managing a single site.

Sites

The first and most obvious difference in the network Dashboard is the Sites menu. Here, you’ll be able to manage all the sites in your network. The following screenshot shows how the list of sites looks like in your Dashboard. As you can see, it’s pretty similar to how posts or pages are listed on a regular WordPress site, isn’t it?

WordPress Multisite - Site Management
The Network Dashboard offers a familiar interface for adding, viewing, and removing your sites.

If you want to create a new site, you simply need to click on Add New and fill all the fields. These include:

  • Site Address (URL). The name of the directory (or sub-domain, depending on how you configured your Multisite) of the new site.
  • Site Title. The title of the site.
  • Site Language. The locale that will be used in that site.
  • Admin Email. The e-mail address of the person who’ll be responsible of administering the new site.
WordPress Multisite - Adding New Sites
Adding a site is as simple as filling these three fields: tell WordPress its URL, name the site, and type in an e-mail address for contacting the new site’s webmaster.

And that’s it! Creating a site is super easy 🙌👏

You can also edit existing sites by simply hovering on them in the Sites screen and clicking on Edit. The Edit screen is organized in four tabs:

  1. Info. Basic information about the site.
  2. Users. The users within the site.
  3. Themes. The currently active theme that’s used in the site.
  4. Settings. Some advanced settings that you can tweak to adapt the behavior of this site.
WordPress Multisite - Site Settings from Network Admin Screen
There’s plenty of settings you can tweak for any given site in your network.

Plugins and Themes

By default, site administrators cannot install new plugins or themes—they can only activate or deactivate the plugins and themes that the network administrator installed. This approach offers one extra layer of security, because regular site administrators won’t be able to add unknown or malicious code in your WordPress installation, and it’s the network administrator’s task to keep everything up-to-date.

WordPress Multisite - Plugin Management
Using the Plugin List in the Network Dashboard, you’re able to activate or deactivate a certain plugin on all sites in your network. One click and everything’s updated!

The previous screenshot shows the list of installed plugins in a WordPress Multisite. Notice that there’s a special action named Network Activate, which doesn’t appear in a regular WordPress installation. If you “network activate” a plugin, the plugin will be active in all the sites in your network, and site administrators won’t have any control on them. If, on the other hand, you install a plugin but don’t “network activate” it, the plugin will be available to site administrators and they’ll be the ones deciding whether they want to use the plugin or not.

Wrapping up

I hope you enjoyed this “brief” introduction to WordPress Multisite. As you’ve seen, it’s quite easy to set up a multisite—getting it up and running is straightforward. I personally like how intuitive it is to navigate from one site to the other, all beautifully presented in a Dashboard I’m already familiar with.

Now it’s your turn! Do you use WordPress Multisites? Where? When? How’s it working for you? Leave your thoughts in the comments section below.

Featured image by U.S. Army MWR.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...

Beautiful Google Maps in WordPress

Published in WordPress.

Nowadays, it’s quite common to see Google Maps embedded in a website—just take a look at our contact page to see an example 😉. They’re a great tool for letting your visitors know where they can find you or where an event you’re organizing will take place. But how can you add a Google Map in your WordPress site? Well, today I’m going to teach you how.

Plugins—The Easiest Way to Add Google Maps in WordPress

If maps play an important role in your website and, therefore, you need to embed them often, then a plugin is probably the solution you need. A quick search in WordPress.org reveals that there’s plenty of plugins for embedding Google Maps in your site. In this post, though, I’m going to focus on MapPress Easy Google Maps, a pretty neat plugin with more than 100,000 active installs.

After installing the plugin, go the plugin‘s settings screen and paste your Google Maps API Keyin the field named (yes, you got it right 😜) Browser API key. If you don’t have one, get yours by following the steps described here.

MapPress Settings Screen
MapPress Settings Screen right after installation. Notice the warning letting us know that we need to add an API Key if we want to use the plugin.

Then click on Save Changes, and go edit the page or post in which you want to add a map.

Now, scroll down until you find a new box named MapPress and click on New Map button to create a new map. This will open the following editor

MapPress Custom Box
Creating and customizing maps is pretty straightforward with MapPress. Just name the map, fill the options, and you’re done!

where you can tweak the map. In particular, you’ll be able to name the map, choose its size, and enter the address it has to pin to (or click on My Location to let the plugin automatically detect where you are). Notice you can add as many markers as you want by locating multiple addresses, one after the other.

Once the map is ready, you simply need to click on Insert into post button and a new shortcode will appear. Easy, huh?

Google Maps iFrames—Because It Only Tooks a Few Clicks

If you don’t want to use a plugin for such a simple action as embedding a map in your WordPress site, you’re lucky! Google Maps makes it super easy to embed maps using iframes. Just open Google Maps in your browser and look for the address you’re interested in. Once you’ve found it, click on the Share button, select the tab Embed map, choose the map size, and copy the iframe. Then, simply paste it in a page or post in your WordPress site and you’re done.

Embedding a Google Map
Google Maps makes it super easy to embed a map in our websites. Just look for the location you’re interested in, click on Share, and copy and paste the iframe tag into your WordPress site.

As you can see, this solution is similar to the previous one in complexity, with its pros and cons. Among its pros, you’ll find there’s no need to get an API key nor to install yet another plugin in your installation to embed maps—iframes are easy to use, fast, and reliable. On the downside, you have to leave WordPress to get the job done. Moreover, if you ever want to change the map, you’ll have to repeat the process and replace the original iframe completely, whereas in the first solution you simply needed to edit the map within MapPress’ box so that the shortcode can load the new version.

Finally, note that this solution is not limited to one marker only—if you’re willing to expend some extra time on it, go to Google’s My Maps and create a custom map with multiple markers, lines, and so on.

Google Maps JavaScript API—Full Control on Your Maps

The last option I wanted to discuss today is the Google Maps JavaScript API (which, by the way, is the solution we’re using in our contact page). This is slightly more complex than what we’ve seen so far, but it definitely pays off if you want to go crazy about your maps. Here’s how it works:

  1. You define a div tag in your HTML code that’ll contain the map,
  2. load the Google Maps JavaScript API using your API Key, and
  3. add a custom script where
    • you specify how the map looks and behaves, and
    • any markers that might be used in it.

Let’s see it with an example. Let’s start by assuming that we already have a div that’ll contain the map, and that it’s identified as neliohq-map—that is, we have a tag such as <div id="neliohq-map">. Now, we simply need to proceed with steps two and three. Loading the Google Maps JavaScript API is as easy as inserting the following script:

Then, you simply need to add the map itself. In order to do this, you have to add the following script in your HTML code after the neliohq-map div tag:

So far, the script is super easy, isn’t it? We’re simply creating a function named loadNelioHQMap and instructing Google Maps to call it when the window is ready (line 5). Of course, we’re not doing anything yet, but getting this right is what matters the most. Then, loading the map is as simple as adding this snippet within the function we just created:

There are three variables in this function:

  • mapEl is a reference to the DOM element neliohq-map which, as we just said, is the div that’ll contain the map itself.
  • mapOptions is a JavaScript object that specifies how the map looks and behaves. If you look at the different options, you’ll see that we’re able to center the map wherever we want, enable or disable drag and zoom controls, and so on.
  • map is the Google Map object itself, which is defined using the constructor new google.maps.Map and passing the other two variables as input parameters.

If you go ahead and try this, you’ll realize that the map looks as you wanted, but there are no markers yet. In order to add one or more markers, just follow this example:

For each marker you want to create, call the constructor google.maps.Marker and specify its settings:

  • map is a reference to the google.maps.Map instance we created before,
  • position is the latitude and longitude location of the marker itself, and
  • icon contains a few settings that define its appearance.

Repeat the previous snippet as many times as you want, and you’ll be able to add as many markers as you need 😁.

Bonus Tip

Finally, I wanted to share a bonus tip with you, folks 😉 If you want your maps to look gorgeous, just take a look at Snazzy Maps—an outstanding website with tons of styles you can use in your maps. Just select the style you like, copy the JavaScript Style Array to your clipboard, and add it as an extra option in your mapOptions object using the key styles:

And that’s all! I hope I helped you add Google Maps in your WordPress site. For questions and feedback, please leave a comment below.

Featured image by NASA.

PoorNot badGoodGreatExcellent (8 votes, average: 3.25 out of 5)
Loading...

Split Testing Genesis WordPress Themes

Published in Online Marketing.

If you’re planning to change the look and feel of your site, then you certainly need A/B testing! It doesn’t matter if it’s going to be a tiny update in your current theme or a completely revamped design; whenever you’re about to change something in your site, you need to make sure that the applied changes will make your site better. Today, we’ll discuss how Nelio A/B Testing can help you test Genesis-based WordPress themes.

WordPress Frameworks

As you may already know, creating themes from scratch is not an easy task. In order to overcome this complexity, one may simply use a Theme Framework, that is, “a drop-in code library used to facilitate the development of a theme”. In simple terms, frameworks are no more than parent themes with several functions and hooks aimed to kick-start the development process. Thus, creating a new theme is as easy as extending the framework through child themes (or even grandchild ones), where style customizations and additional functionality can be added.

Genesis Framework
Screenshot of the StudioPress website, where you can buy the Genesis Framework

One of the most popular frameworks out there is Genesis. It has clean and responsive HTML 5 code, it’s optimized for search engines, and it’s extremely powerful and reasonably priced. And, more importantly, it comes with regular updates and great support, probably because of its fame ;-).

How to Test Changes in my Current Theme

The process of creating A/B experiments is always the same:

  1. Think about what you want to test: variation of our theme
  2. Identify the goals you want to achieve: get more subscriptions
  3. Map each goal, to the elements that can help you reach it: to subscribe, a user has to fulfill the subscription form (available in the sidebar of our blog)
  4. Run the experiment and analyze the results!

Let’s assume we’re interested in creating an A/B experiment for increasing the subscriptions to our mailing list. Our blog looks like this:

Jane Genesis theme with right sidebar
Screenshot of WPrincipiante (a WordPress blog in Spanish) using the Jane Genesis theme with a right sidebar

with a right sidebar. Most western countries read from left to right, so maybe if we move the sidebar to the left it will gather more attention and, hopefully, more people will see the subscription form. So, what if the sidebar was on the left? Would that change have any impact on the subscriptions? Well, let’s test it!

Duplicate your Current Theme

Our blog is using Jane, a Genesis-based theme. As such, it offers several customization options and, in particular, it lets us modify the layout. So, how can we test the previous example? The first thing we’ll have to do is duplicate our current theme:

  1. Go to WORDPRESS_INSTALL_DIR/wp-content/themes
  2. Copy the directory jane and all its contents to a new one: cp jane jane-2
  3. Edit the file jane-2/style.css and change the Theme Name: jane block to Theme Name: jane 2 (or whichever name you want to use)

* Alternatively, we could have used Duplicate Theme, a plugin that eases the process of duplicating themes (either by creating exact copies or child themes).

Now we have two themes that are exactly equal. However, they won’t probably look exactly equal, for all the customizations we made to our original jane theme where stored in the database, and those have not been duplicated. That can be easily solved using the Import/Export utility offered by Genesis:

  1. Access the Dashboard
  2. Go to Genesis » Import/Export
  3. Select all checkboxes and click on Download Export File
  4. Go to Appearance » Themes
  5. Activate the alternative theme Jane 2
  6. Go to Genesis » Import/Export
  7. Import the export file we created in step 3
  8. Make sure that the menus and widgets are properly defined in the alternative theme
  9. Go to Appearance » Themes

Finally! Both themes are the same and look exactly alike.

Configure the Alternative Theme

In order to configure the alternative theme, we simply need to activate it (under Appearance » Themes) and configure all the changes we want to test respect to the original one. Among the changes, we may include new CSS styles, different layouts, alternative color palettes, and so on. In our particular example, however, we’re only interested in changing the layout:

  1. Go to Genesis » Theme Settings
  2. Under Default Layout, select the new layout
Screenshot of Genesis Settings
You can easily change the layout of your blog using the Genesis Settings

And that’s it! Easy peasy 🙂 Now you may want to reactivate the original theme (under Appearance » Themes).

Thesis theme with left sidebar
Screenshot of WPrincipiante (a WordPress blog in Spanish) using the alternative version, where the sidebar is on the left

The A/B theme Test

Once we have both themes configured, we can create the theme experiment. In essence, these are the required steps:

  1. Go to Nelio A/B Testing » Add Experiment
  2. Select New A/B Theme Test
  3. Fill all the basic information and click on Next
  4. Select the themes Jane and Jane 2
  5. Add the desired conversion goals (in our example, the user has to submit the appropriate Gravity Form for subscribing)

Once we have everything set up, it’s time we run the experiment. We simply Start it and wait for the first results to come.

Make the Winner Theme Permanent

After a while, we’ll have detailed information on the conversion rates of each version and, if we’re lucky, one version will be clearly better than the other. When the results are statistically significant, we may stop the experiment and set the winning alternative as our new current theme.

If the original version won, you’re done! But, what if it was the alternative? We just stopped the experiment and, therefore, all our users are now seeing the original (worse) version! In order to make the alternative version (Jane 2) permanent, we have two options:

  1. We simply go to Appearance » Themes and select Jane 2 (and ignore, from now on, the original Jane theme). This is quite easy to do, but we won’t receive future updates of the theme.
  2. We manually apply to Jane the changes we applied to Jane 2. In order to do so, simply activate Jane 2, export its settings, reactivate Jane, and import Jane 2′s settings (which, in our case, will include the alternative layout).

Sum Up

In this post we’ve seen how to split test a Genesis theme. Basically, you just need to duplicate it, perform all the changes you want to test in the duplicate theme, and create a new A/B Theme test experiment to see if the changes make your site perform better than before (wrt the conversion goals you are interested in). This new experiment will test the original Genesis theme and the duplicate version you just created and configured. Finally, when the results are available, you need to make permanent the winning version (which might require some manual work).

I hope you liked this post! 😀 If you’re interested in theme testing, or if you want to share your ideas about the overall process, please comment!

Featured Image by John Morgan.

PoorNot badGoodGreatExcellent (No Ratings Yet)
Loading...