<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sasa Stojanovic on Medium]]></title>
        <description><![CDATA[Stories by Sasa Stojanovic on Medium]]></description>
        <link>https://medium.com/@sasa.stojanovic876?source=rss-8955ab895e95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WFGUCmTAcyRWaS2B.jpg</url>
            <title>Stories by Sasa Stojanovic on Medium</title>
            <link>https://medium.com/@sasa.stojanovic876?source=rss-8955ab895e95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:56:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sasa.stojanovic876/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Display Posts on Page in WordPress — Qode Interactive]]></title>
            <link>https://medium.com/@sasa.stojanovic876/how-to-display-posts-on-page-in-wordpress-qode-interactive-eacedd9b26c2?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/eacedd9b26c2</guid>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Wed, 02 Sep 2020 13:00:55 GMT</pubDate>
            <atom:updated>2020-09-22T08:09:17.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display Posts on Page in WordPress — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lg8FJTJ7CC-7j6Xr.jpg" /></figure><p>Apart from producing engaging and insightful content, WordPress bloggers have to constantly work on retaining their readers. One way to do it is by making pages that contain all your posts, with the latest ones on top. By doing so you are ensuring that your readers, after finishing an article they enjoyed, can find additional relevant content. The benefits are quite clear — your posts will have more views, giving you greater reach and the possibility to achieve a bigger revenue from ads and affiliate links.</p><h3>Showing all posts on one page</h3><p>There are various methods you can use to display posts on page in WordPress. We will show some of the ways we found most useful. You should try all our suggestions until you find the one best suited to your needs. Therefore, if you’d like to skip ahead to a particular method, in this article we’ll cover the following:</p><ul><li><a href="https://qodeinteractive.com/magazine/display-posts-on-page-in-wordpress/#wordpress-default-posts-page">Using the WordPress default Posts page</a></li><li><a href="https://qodeinteractive.com/magazine/display-posts-on-page-in-wordpress/#theme-specific-blog-page-templates">Using theme-specific blog page templates</a></li><li><a href="https://qodeinteractive.com/magazine/display-posts-on-page-in-wordpress/#using-plugins">Using plugins</a></li><li><a href="https://qodeinteractive.com/magazine/display-posts-on-page-in-wordpress/#creating-custom-blog-template">Creating your custom blog template</a></li></ul><h4>Using the WordPress default Posts page</h4><p>One of the default WordPress functionalities is to show your latest posts on your homepage. However, users often want to differentiate between their homepage and the page that contains the posts. This can be easily set as it is one of the default WordPress options, located in the Settings section.</p><p>A prerequisite for this method is having a blank page (without previous content), which will serve to show all your posts. If you don’t have such a page, create it by <strong>navigating to Pages &gt; Add New</strong>. <strong>Add an appropriate name</strong> to the page (e.g. Blog), and <strong>press the <em>Publish</em> button</strong>.</p><p>When you’ve created the page, <strong>navigate to Settings &gt; Reading</strong>. Under <em>Your homepage displays</em> <strong>choose the option for <em>A static page</em></strong>. This will enable you to select one page as your homepage and another page as your Posts page. The latter option is what we are interested in. <strong>You’re going to use the blank page you created earlier and set it as your Posts page</strong> by finding and selecting it from the dropdown menu. Then, <strong>press the <em>Save Changes</em> button</strong> below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*EtWzidYaj2Sz3hBT.jpg" /></figure><p>This will show all the WordPress posts on that one page, and they will be stylized based on the theme you are using. An additional setting you should be aware of is <strong>the <em>Blog pages show at most</em> option</strong>, which can be seen on the screenshot above. Its default value is set to 10, meaning it will show up to 10 posts on a single page. Therefore, if your website has more than 10 posts, your newly created Posts page will have a pagination feature near the bottom of the page, letting readers see how many pages of content there are in your blog. However, if you don’t want to have the pagination feature and want to show all posts on that page instead, you can do that. Simply insert a number that is greater than your current number of posts on the website. But, take into consideration that this has two serious drawbacks. A large number of posts will increase the time your blog page takes to load, as well as make the page very long and difficult to scroll across.</p><p>After you adjust the number of posts that will be shown per page, you are done. The only thing that remains is to <strong>check your Posts page</strong>. Depending on the theme you’re using, it might look like the screenshot given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_uuEw910tausqH0v.jpg" /></figure><p>However, <strong>if you realize you don’t find the design of your Posts page appealing, we advise unselecting the page you choose as your Posts page and trying some of our other suggestions below</strong>.</p><h4>Using theme-specific blog page templates</h4><p>If you don’t want to use the Posts page functionality or don’t like its design, you should see if the theme you are using has a page template that fits your needs. Themes will often include blog-related page templates, so you should investigate if this is also the case with the theme you are currently using. Checking this is easy. You only need to <strong>click to edit a page</strong> and then <strong>locate the Page Attributes section</strong> on the right side of the screen. <strong>When you click on the dropdown next to the <em>Template:</em> option</strong>, you will see the list of page templates available within your theme. Look for templates that contain the word <em>Blog</em>. In case you find there are multiple templates available, make sure to examine them all, to find the one that’s most appealing to you. You can do that simply by <strong>selecting a template</strong> and <strong>pressing the <em>Update</em> button</strong> to update the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DWcCXQnIvnQY9cdF.jpg" /></figure><p>Afterward, <strong>check the page</strong> which will contain all your WordPress posts. Depending on the theme you’re using, it might look similar to our screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*k6-HNcc4NiqVxVtN.jpg" /></figure><p>Repeat the same process for all your theme’s available blog-related page templates until you find the one you like. <strong>If, however, your theme doesn’t have relevant page templates or you aren’t satisfied with the look of the page templates you checked, try one of our other suggestions</strong>.</p><h4>Using plugins</h4><p>One of the greatest advantages of WordPress is the plethora of plugins it has developed for almost any purpose. Therefore, to solve a problem or add a feature, you will often need to investigate and test certain plugins.</p><p>Firstly, look whether the plugins you already have active on your site contain an option or a shortcode that could help show all your WordPress posts on a single page. This process greatly differs based on the plugins you are using, so we can’t provide you with any universal instructions on the matter. If you weren’t able to find a suitable option or shortcode, explore the available <a href="https://wordpress.org/plugins/">WordPress plugins</a>.</p><p>One of the free plugins we found most useful is the <a href="https://wordpress.org/plugins/wp-show-posts/">WP Show Posts</a>. After installing it, navigate to <strong>WP Show Posts &gt; Add New</strong> to create a new shortcode. Using it, we will add all the posts to our page. <strong>Add the title, choose a taxonomy</strong> (e.g. category), and <strong>then tick all the terms</strong> of your chosen taxonomy to show all posts. Tick the checkbox next to <em>Pagination</em> to enable pagination and, if you want, change the number of posts per page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*uHRzjaVIUypIU_sY.jpg" /></figure><p>You can go through the remaining option tabs to adjust the options that will be relevant to you. Among others, these tabs include options regarding the number of columns and the space between the columns, whether the post should contain its featured image, as well as the alignment and location of that image. There are options regarding the length of the excerpt, the possibility of renaming the <em>Read more</em> button, the choice to add relevant metadata (author, date, category), as well as to exclude some posts (by ID or author) and adjusting the ordering rules.</p><p><strong>Carefully examine and adjust these options</strong>. When you’re done, <strong>press the <em>Publish</em> button</strong> in the right section of the screen. Then, <strong>copy the shortcode</strong> from the Usage section on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OfGe3cHdIyxsK8xw.jpg" /></figure><p>You need to <strong>paste this shortcode inside your page</strong>. Depending on which page builder you are using, this process can vary. We will show how it looks in a few different page builders.</p><ul><li><strong>Gutenberg</strong></li></ul><p><strong>Click on the “+” sign</strong> to add a Gutenberg block and <strong>search for <em>shortcode</em></strong>. Then <strong>click on the Shortcode widget</strong> to add it and <strong>paste the previously copied shortcode inside it</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*wP5oBoPKnxcFpWld.jpg" /></figure><p>Afterward, update the page by <strong>pressing the <em>Update</em> button</strong> on the right.</p><ul><li><strong>Elementor</strong></li></ul><p><strong>Add a Text Editor</strong> element from the list of basic widgets and <strong>insert the copied shortcode inside its Visual tab</strong>. Afterward, update the page by <strong>pressing the <em>Update</em> button</strong> at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*C1Vc3Xzuw2GZvwTW.jpg" /></figure><ul><li><strong>WPBakery Page Builder</strong></li></ul><p><strong>Add the Text Block element</strong> from the list of the available WPBakery elements. Then, <strong>paste the copied shortcode</strong> within the Visual tab of the General section. Finally, <strong>press the <em>Save changes</em> button</strong> within the Text Block element, followed by <strong>pressing the <em>Update</em> button</strong> in the right section of your page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ALOcFIY2-rDk_cx8.jpg" /></figure><p>After inserting the shortcode using your preferred page builder, <strong>check the page</strong>. Depending on your chosen design and options set in the plugin, your page might look similar to our screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*biHq7jJYUHUKPNlJ.jpg" /></figure><h4>Creating your custom blog template</h4><p>If you have already tried our previous suggestions but didn’t like the resulting page, then the best way for you is to create your blog template using code. However, we don’t advise this to any newer WordPress users, as it requires significant coding knowledge, as well as <a href="https://qodeinteractive.com/magazine/how-to-use-ftp/">the use of FTP</a>. But if you do decide to try this method, we highly advise you <a href="https://qodeinteractive.com/magazine/how-to-manually-backup-wordpress-website/">to backup your website</a> before attempting to make a custom template. Keep in mind any coding error can break your site.</p><p>The first step to creating a custom page template is creating a new file at the proper location and naming it adequately. To do so, <strong>connect to your server</strong> using your FTP credentials and <strong>navigate to your root WordPress directory</strong>. Then, <strong>navigate to</strong> the directory of the theme you are currently using, i.e. <strong>the /wp-content/themes/theme-name/ directory. Right-click within that directory while making sure not to click on any of the files of subfolders found there</strong>. Then, <strong>click on the <em>Create new file</em> option</strong> from the menu that appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*P3V6NTPYEiFTaRj0.jpg" /></figure><p>The file name should be written lowercase, with a .php extension at the end. In the case of multiple words, instead of spaces, use a hyphen (-) between the words. Meaning, <strong>name the file</strong> in the following format: your-file-name.php, after which you should <strong>press the <em>Ok</em> button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*I471WV3ETRvJ8XXx.jpg" /></figure><p>This will create an empty .php file where you need to add appropriate code for your <a href="https://developer.wordpress.org/themes/template-files-section/page-template-files/">page template</a>.</p><p>To create a page template that shows all posts, you only need to implement the <a href="https://developer.wordpress.org/themes/basics/the-loop/">WordPress Loop</a>. As coding a page template from scratch can be quite challenging, you can always use the code from the <strong>page.php</strong> file of your theme as a baseline, and then adjust it according to your needs. Additionally, you can also use the page template we created for this article.</p><pre>&lt;?php</pre><pre>/*</pre><pre>Template Name: Blog posts template</pre><pre>*/</pre><pre>$blog_posts = <strong>new</strong> WP_Query( array( ‘post_type’ =&gt; ‘post’, ‘post_status’’ =&gt; ‘publish’, ‘posts_per_page’ =&gt; -1 ) );</pre><pre>get_header();</pre><pre>?&gt;</pre><pre>&lt;div <strong>class</strong> = “page-container”&gt;</pre><pre>&lt;div <strong>class</strong> = “main-content”&gt;</pre><pre>&lt;?php <strong>if</strong> ( $blog_posts-&gt;have_posts() ) : ?&gt;</pre><pre>&lt;div <strong>class</strong> = “blog-posts”&gt;</pre><pre>&lt;?php <strong>while</strong> ( $blog_posts-&gt;have_posts() ) : $blog_posts-&gt;the_post(); ?&gt;</pre><pre>&lt;article id = “post-&lt;?php the_ID(); ?&gt;”&gt;</pre><pre>&lt;a href = “&lt;?php the_permalink(); ?&gt;”&gt;</pre><pre>&lt;?php <strong>if</strong> ( has_post_thumbnail() ) {</pre><pre>the_post_thumbnail( get_the_ID(), ‘full’ );</pre><pre>} ?&gt;</pre><pre>&lt;h2 <strong>class</strong> = “post-title”&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;</pre><pre>&lt;/a&gt;</pre><pre>&lt;div <strong>class</strong> = “post-category”&gt;</pre><pre>&lt;?php the_category(‘, ‘); ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div <strong>class</strong> = “post-excerpt”&gt;</pre><pre>&lt;?php wp_kses_post( the_excerpt() ) ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;span <strong>class</strong> = “post-read-more”&gt;</pre><pre>&lt;a itemprop = “url” href = “&lt;?php the_permalink(); ?&gt;” target = “_blank”&gt;</pre><pre>&lt;?php echo esc_html__( ‘Read more’, ‘theme-domain’ ) ?&gt;</pre><pre>&lt;/a&gt;</pre><pre>&lt;/span&gt;</pre><pre>&lt;/article&gt;</pre><pre>&lt;?php endwhile; ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;?php <strong>else</strong>: ?&gt;</pre><pre>&lt;p <strong>class</strong> = “no-blog-posts”&gt;</pre><pre>&lt;?php esc_html_e(‘Sorry, no posts matched your criteria.’, ‘theme-domain’); ?&gt;</pre><pre>&lt;/p&gt;</pre><pre>&lt;?php endif;</pre><pre>wp_reset_postdata(); ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div <strong>class</strong> = “sidebar-content”&gt;</pre><pre>&lt;?php get_sidebar(); ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;?php get_footer(); ?&gt;</pre><p>As this code may seem intimidating to less experienced WordPress users, we will try to carefully explain it.</p><p>Firstly, by starting the file with a comment stating the template name we are making sure that it is a <strong>global template that can be chosen from the dashboard using the Page Attributes section on any page</strong>. Simply pick the template with that exact name. As such, <strong>make sure to add a clear name that you’ll recognize later</strong>.</p><pre>/*</pre><pre>Template Name: Blog posts template</pre><pre>*/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*D-izZwbpAyBi4zhl.jpg" /></figure><p>As for the <a href="https://developer.wordpress.org/reference/functions/get_header/">get_header()</a> and <a href="https://developer.wordpress.org/reference/functions/get_footer/">get_footer()</a> functions at the beginning and the end of the code, they serve to include the header and footer template of your theme on your template page. Which brings us to the main section of the code.</p><p>By using the following code:</p><pre>$blog_posts = <strong>new</strong> WP_Query( array( ‘post_type’ =&gt; ‘post’, ‘post_status’’ =&gt; ‘publish’, ‘posts_per_page’ =&gt; -1 ) );</pre><p>we are simply storing the data on <strong>all of our published posts</strong> in the $blog_posts variable. We have done so by using the <a href="https://developer.wordpress.org/reference/classes/wp_query/">WP_Query class</a>. In case you aren’t familiar with this class, we highly recommend that you study the link we included and pay special attention to the parameters it accepts.</p><p>Now, let us break down the remaining code step by step. Firstly, looking at the code structure, you can see that the page has two sections. Those are the main content and the sidebar, with a div that wraps both sections. We have added custom classes to the corresponding HTML elements as it will help with the CSS customization, should we need it at the end. <strong>As for the sidebar, it will show the widgets within the default widget area called <em>Sidebar</em>, which you can find and edit in Appearance &gt; Widgets</strong>. This is achieved using the <a href="https://developer.wordpress.org/reference/functions/get_sidebar/">get_sidebar()</a> function.</p><pre>&lt;div <strong>class</strong> = “page-container”&gt;</pre><pre>&lt;div <strong>class</strong> = “main-content”&gt;</pre><pre>// Main content code goes here</pre><pre>&lt;/div&gt;</pre><pre>&lt;div <strong>class</strong> = “sidebar-content”&gt;</pre><pre>&lt;?php get_sidebar(); ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><p>Let us delve deeper into the code that is contained within the main content (section whose class is main-content). It can also be simplified and looked at in the manner given below.</p><pre>&lt;?php <strong>if</strong> ( $blog_posts-&gt;have_posts() ) : ?&gt;</pre><pre>&lt;div <strong>class</strong> = “blog-posts”&gt;</pre><pre>&lt;?php <strong>while</strong> ( $blog_posts-&gt;have_posts() ) : $blog_posts-&gt;the_post(); ?&gt;</pre><pre>&lt;! — Loop content goes here →</pre><pre>&lt;?php endwhile; ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;?php <strong>else</strong>: ?&gt;</pre><pre>&lt;p <strong>class</strong> = “no-blog-posts”&gt;</pre><pre>&lt;?php esc_html_e(‘Sorry, no posts matched your criteria.’, ‘theme-domain’); ?&gt;</pre><pre>&lt;/p&gt;</pre><pre>&lt;?php endif;</pre><pre>wp_reset_postdata(); ?&gt;</pre><p><strong>This is, in fact, the aforementioned WordPress Loop</strong>. Simply put, if there are posts within the $blog_posts variable, the first section of the code will be executed. Otherwise, a paragraph stating “Sorry, no posts matched your criteria” will be shown. And, in the end, we are restoring the global $post to the post in the main query.</p><p>As for the first code section, it contains a div with the custom class “blog-posts” whose content is generated based on the current post in the inner while loop.</p><p>To conclude the elaboration of our template code, we’re going to touch upon that last part of the inner content.</p><p>Using the WordPress loop within our custom page template, we can create a separate article section for every blog post on our site. That article section contains <strong>a link, categories, excerpt, and a <em>Read more</em> button corresponding to every particular post</strong>. The link is wrapped around two items — <strong>the featured image of the post and its title</strong>. However, <strong>if the post doesn’t have a featured image, then only the title is shown</strong>.</p><pre>&lt;article id = “post-&lt;?php the_ID(); ?&gt;”&gt;</pre><pre>&lt;a href = “&lt;?php the_permalink(); ?&gt;”&gt;</pre><pre>&lt;?php <strong>if</strong> ( has_post_thumbnail() ) {</pre><pre>the_post_thumbnail( get_the_ID(), ‘full’ );</pre><pre>} ?&gt;</pre><pre>&lt;h2 <strong>class</strong> = “post-title”&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;</pre><pre>&lt;/a&gt;</pre><pre>&lt;div <strong>class</strong> = “post-category”&gt;</pre><pre>&lt;?php the_category(‘, ‘); ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div <strong>class</strong> = “post-excerpt”&gt;</pre><pre>&lt;?php wp_kses_post( the_excerpt() ) ?&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;span <strong>class</strong> = “post-read-more”&gt;</pre><pre>&lt;a itemprop = “url” href = “&lt;?php the_permalink(); ?&gt;” target = “_blank”&gt;</pre><pre>&lt;?php echo esc_html__( ‘Read more’, ‘theme-domain’ ) ?&gt;</pre><pre>&lt;/a&gt;</pre><pre>&lt;/span&gt;</pre><pre>&lt;/article&gt;</pre><p>We hope you’ll find the template that we included in the article is much clearer now that we explained it following a “top-down” view. <strong>You can adjust the code to your needs, by adding, removing, or interchanging different parts of it</strong>.</p><p>After you are done with your editing, you can insert the code in the file you previously created. This is also done via FTP. <strong>Right-click the file</strong> you previously created and <strong>select the <em>View/Edit</em> option</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0T3UPwTWYs3W3Mw3.jpg" /></figure><p><strong>Open the file</strong> using any text editor and <strong>insert the code</strong> you created. Afterward, <strong>save the changes</strong> and <strong>upload the file</strong> back to the server, thus overriding the current, empty, one.</p><p>After you finish creating the template, <strong>you will need to check how the content generated by this template looks on the website</strong>. To do so, <strong>create a new page</strong> on your website and <strong>assign your custom page template to it</strong> using the Page Attributes section on the right. Then, <strong>examine the page frontend</strong>. Even though it will be functional, <strong>you will most likely need to create additional CSS</strong> to tailor the display. You can add custom CSS in Appearance &gt; Customize &gt; Additional CSS or even enqueue it using <a href="https://developer.wordpress.org/reference/functions/wp_enqueue_style/">the wp_enqueue_style function</a>.</p><p>Here’s how the template we included looks with a little bit of additional CSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*rO0iCc91laKnYKjK.jpg" /></figure><h3>Final thoughts</h3><p>Providing your readers with easy access to your posts can have many benefits. From generating value so people can connect to you or your brand to boosting your SEO ranking, or anything in-between. And you can achieve this by creating a page showing all your posts so users get their pick of content and you can organize your site better. We invite you to try using any of the methods we outlined in the article and see how each can contribute to your WordPress website. Finally, make sure to bookmark this article, as it will surely be helpful for your future blogging efforts.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/display-posts-on-page-in-wordpress/"><em>https://qodeinteractive.com</em></a><em> on September 2, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eacedd9b26c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix the err_too_many_redirects WordPress Error — Qode Interactive]]></title>
            <link>https://medium.com/@sasa.stojanovic876/fix-the-err-too-many-redirects-wordpress-error-qode-interactive-59b76bdbc869?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/59b76bdbc869</guid>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Sat, 18 Jul 2020 13:00:34 GMT</pubDate>
            <atom:updated>2020-09-16T16:08:23.869Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fix the err_too_many_redirects WordPress Error — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hjmF1HGCjV8NzyFr.png" /></figure><p>Getting WordPress errors can be quite stressful for any user. Furthermore, if you have very little information to go on, solving them can seem quite challenging. One such error that can occur quite frequently is the <em>Too Many Redirects</em> error. It appears when you try to access a certain page and it takes too long to load because the page is getting redirected to other links. And even after waiting, you end up getting a blank page suggesting this error instead of the page you were looking for. If this has ever happened to you, you should know that there’s nothing to worry about. In this article, we will take a closer look at what this error is and how to tackle it using a few simple methods:</p><ul><li><a href="https://qodeinteractive.com/magazine/err-too-many-redirects/#clear-cache-and-cookies">Clear cache and cookies</a></li><li><a href="https://qodeinteractive.com/magazine/err-too-many-redirects/#check-the-url-of-thesite">Check the URL of the site</a></li><li><a href="https://qodeinteractive.com/magazine/err-too-many-redirects/#disable-plugins">Disable plugins</a></li><li><a href="https://qodeinteractive.com/magazine/err-too-many-redirects/#recreate-the-htaccess-file">Recreate the .htaccess file</a></li></ul><h3>What Is the Too Many Redirects Error</h3><p>Depending on the browser, there are multiple messages variations that can be displayed for this error. In Chrome and Microsoft Edge, users will be told that the address has <strong>redirected you too many times</strong>. While in Mozilla the message states that <strong>the page isn’t redirecting properly</strong>. Some browsers may also offer a helpful piece of advice on how to solve the issue besides showing the error message. For example, Chrome suggests that you <strong>try clearing your cookies</strong>, which is one of the first steps for troubleshooting this error. It also references the error under the term <em>ERR_TOO_MANY_REDIRECTS</em> that you can use to search further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*rj2Zzjb_HPw1IQKC.png" /></figure><p>As for the error itself, it means that your website is caught in an infinite redirection loop. Essentially, when you try to access a URL, you are redirected to another, then back to the first, and so forth. That’s why <em>redirection loop</em> is another term used for this error. Therefore, we will use all three terms interchangeably — Too <em>many redirects, err_too_many_redirects</em>, and <em>redirection loop issue</em> in this article.</p><h3>How to Solve the Too Many Redirects Error</h3><p>Now that we’ve explained what the error is, we can proceed to solve it efficiently. There are many reasons why the <em>Too Many Redirects</em> error can occur. Those include various caching issues, improperly set website URLs, and faulty code. Therefore, we have carefully divided the troubleshooting steps into four separate sections, which you should carefully follow.</p><h3>Clear Cache and Cookies</h3><p>As redirect loops can happen due to cached data, we suggest clearing all cache as a first troubleshooting step. For ease of use, we grouped all relevant forms of cache clearing in this section. Please note that <strong>clearing any type of cache may impact your website loading</strong>. Nevertheless, this is an important step towards solving the redirect loop issue.</p><p>1.Clear browser cache and cookies</p><p>WordPress uses browser cookies for user authentication and managing sessions. However, a user may experience the Too <em>Many Redirect</em> issue if the cookies that the browser uses have been cached too long and are no longer valid. Clearing browser cache is often the simplest way of solving the issue. In the sections below you can find the instructions for cache clearing in Chrome and Mozilla. The procedure in other browsers may differ so you might need to do some additional research.</p><ul><li>Google Chrome</li></ul><p>To clear the browser cache inside Google Chrome <strong>click on the three dots</strong> in the top right corner of the screen. Click on the <strong>History</strong> option followed by a click on <strong>the option with the same name</strong> in the submenu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*L1iz0htzexZcDR6c.png" /></figure><p>Your Chrome browser history will open in a new window. <strong>Find the <em>Clear browsing data</em> option</strong> in the top left corner of the screen and <strong>click on it</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0YDMK61TWXLw0U8Z.png" /></figure><p>This will open a popup window. Click on <strong>the <em>Basic </em></strong>tab within and choose the appropriate <strong>time range. Make sure to tick the <em>Cookies and other site data</em> and <em>Cached images</em> <em>and files</em> options then click on the <em>Clear data</em></strong>, afterward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ynwzlHo5gO-7aeIh.png" /></figure><ul><li>Mozilla Firefox</li></ul><p>Clearing the cache in Firefox is done by clicking on <strong>the hamburger menu</strong> in the top right corner and then <strong>clicking on <em>Options</em></strong> from the menu that opens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RxdNW1_44AfmmbZ1.png" /></figure><p>In the window that opens, click on <strong>the <em>Privacy &amp; Security</em> option</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*NmQYzW099ULBp7co.png" /></figure><p><strong>Scroll down to the <em>Cookies</em> and <em>Site Data</em> section and click on the <em>Clear Data</em> button.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*U9zbxoC1wAvIAkrF.png" /></figure><p>A popup window will open. <strong>Tick both the <em>Cookies and Site Data</em> and <em>Cached Web Content</em> options and then click on the <em>Clear</em> button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_UYdfhcyYTlBsDeX.png" /></figure><p>Since caching issues are a common cause of redirect loops, you should test whether clearing the cache fixed the error. This is done by simply trying to access the page that was previously showing the <strong>err_too_many_redirects</strong> message. <strong>If the <em>Too Many Redirects</em> issue is still present, we suggest clearing all other forms of cache, as shown in the sections below</strong>.</p><p>2.Clear plugin cache</p><p>Caching plugins are quite important for most WordPress websites. They reduce the page load times significantly as they serve static (cached) versions of your web pages to users. However, despite being quite beneficial, caching plugins can lead to a lot of common WordPress errors, including the redirect loop issue. Therefore, if you experience a type of redirect loop that allows you access to the backend only, you can easily test if this is the case. You only need to clear the plugin cache through the plugin options.</p><p>We used WP Fastest Cache and its options to do this. In the admin dashboard, <strong>hover over the <em>Delete Cache</em> option</strong> in the top navigation tab and <strong>click on <em>Clear All Cache</em> in the dropdown menu</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kXdsSKPZzHDel8hc.png" /></figure><p>Then, check the frontend of your site. If you can see the frontend of your site, then you’ll know a plugin was the cause and that you’ve successfully solved the issue. If your frontend still displays the error, you should try using one of the other methods suggested in this article.</p><p>Also, a clarification before we proceed. Purging is another common term for clearing the cache and it is mostly used for WordPress caching plugins. Depending on the plugin, the options you need to look for, which are present across a multitude of caching plugins, are <strong>purging single pages or purging all plugin cache</strong>.</p><p>3.Clear server cache</p><p>If the act of clearing the cache in the browser and caching plugin failed to solve the redirect loop issue, then <strong>clearing the server cache should be your next step</strong>. However, we suggest that you consult your hosting provider for the exact steps, as they can differ depending on the provider.</p><p>4.Clear CDN cache</p><p>A CDN, meaning content delivery network, is often used for serving static site resources (JS and CSS stylesheets and images) to improve website speed. Although quite rare, <strong>CDN caching issues can happen</strong>. Therefore, if you are using CDN, it is important to exclude it as the possible cause behind the <em>Too Many Redirects</em> issue by testing.</p><p>Any good caching plugin allows integration with a CDN. The one we used, <a href="https://wordpress.org/plugins/wp-fastest-cache/">WP Fastest Cache</a>, is no exception. Depending on the plugin you choose to use, the appropriate option you should look for may be called <em>Purge CDN cache</em> or <em>Clear CDN cache</em>. In the case of WP Fastest Cache, that option is called <em>Remove Integration</em>. Despite the difference in names, those options serve virtually the same purpose, testing-wise.</p><p>Therefore, <strong>navigate to the <em>WP Fastest Cache</em> section</strong> from the left side menu and <strong>click on the CDN tab</strong>. Select your CDN service followed by a click on the <strong><em>Remove integration </em></strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*O6oYpT7PxTOdVuxx.png" /></figure><p>Check your site afterward to see if the <em>Too Many Redirects</em> error is gone. If it isn’t, you should proceed to the next troubleshooting method.</p><h3>Check the URL of the Site</h3><p>One of the more common reasons for the redirect loop is having incorrect website URLs. If you can log in to your admin panel, you should use the general settings to adjust the URLs of your site. By URLs of your website, we mean the <strong>Site Address</strong>, which is the URL that your visitors type in to reach your site, and the <strong>WordPress Address</strong>, which represents the locations of your WordPress files and folders.</p><p>To change both addresses, <strong>navigate to Settings &gt; General and update your WordPress and Site Address to properly reflect the current addresses of your site. This is particularly important for any site that was migrated or has switched from HTTP to HTTPS</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*7RdYdErTY6VxwNbe.png" /></figure><p>In most cases, the two addresses should be the same. However, there are exceptions, such as when your WordPress folders and files are stored in a separate subdirectory.</p><p>Afterward, <strong>click on the Save Changes button</strong> in the bottom left corner of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QM7nieD4Bxzqj1q1.png" /></figure><p>If you are unable to login to your admin dashboard, you should try to find some other means of <a href="https://qodeinteractive.com/magazine/how-to-change-wordpress-url/">changing your Site and WordPress URLs</a>. One of the ways you can do it is by editing the <strong>wp-config.php</strong> file, located in <strong>your root WordPress directory. Connect to your server</strong> using your FTP credentials and open your WordPress directory, often called public_html. <strong>Locate the wp-config.php file within, right-click it, and select the View/Edit option</strong> from the dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*E52YgnINyOgFvyuz.jpg" /></figure><p><strong>Open the file using a text editor and insert this code</strong> above the /* That’s all, stop editing! Happy blogging. */ line.</p><pre>define(‘WP_HOME’,’https://your-website.com&#39;);</pre><pre>define(‘WP_SITEURL’,’https://your-website.com&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*reETv7DtW-IdPs_R.jpg" /></figure><p>A few remarks about the code:</p><ul><li>Replace the your-website part of the code with your actual website URL</li><li>Don’t put a trailing slash (“/”) at the end of your URL address</li><li>If your URL contains www, don’t forget to add that in as well</li></ul><p>After making the changes, <strong>save the file</strong> and <strong>upload it back to your server</strong>, to override the one currently there. Then, <strong>try to access your website</strong> to determine if the error is gone.</p><h3>Disable Plugins</h3><p>Some plugins may use various redirection techniques that can lead to redirection loops. Other times, a simple plugin activation or update can cause it, as well. For this reason, we suggest that you thoroughly check your plugins, if trying previous methods didn’t solve the issue.</p><p>Connect to your server using your FTP credentials and navigate to the <strong>root WordPress directory</strong> (often called public_html). <strong>Open the wp-content folder, right-click on the plugins folder found within, and select the Rename option</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ttyfiDyPPtCoSzaX.jpg" /></figure><p><strong>Rename the plugins folder to deactivate it</strong>. Any name will do, but we advise using the original and adding some text onto it, so you’ll have a record of what was done. Examples include <strong>plugins.old</strong> and <strong>plugins.deactivated</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*o6sbS6CV8yTyLC8-.jpg" /></figure><p><strong>Afterward, try to access the page that was showing the <em>Too Many Redirects</em> error earlier. If you are able to access it without the error re-appearing, the issue is caused by a faulty plugin. To pinpoint which one, you need to re-activate them all and then deactivate one by one whilst checking if the access issue is present.</strong></p><p>Specifically, this section will show you what steps you need to take. First, <strong>log in to your dashboard</strong> while your plugins folder is still renamed. Then, with the use of an FTP client, <strong>return that folder to its original name — <em>plugins</em></strong>. This will allow you to activate the plugins manually within your dashboard. So, stay logged into your dashboard, navigate to <strong>Plugins &gt;</strong> <strong>Installed Plugins</strong>, and <strong>activate all your plugins</strong> manually. Then, <strong>log out of your admin dashboard</strong>.</p><p>Assuming that you are still connected to your server using FTP, navigate to <strong>your-site/wp-content/plugins/</strong>. Then <strong>right-click a plugin’s folder</strong> and select <strong>the Rename</strong> option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*r3giRLBe4Jzf4bO1.jpg" /></figure><p>Then <strong>rename the plugin’s folder</strong> (suggested rename options being <em>plugin-name.old</em> or <em>plugin-name.deactivated</em>) to deactivate that particular plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ug_e_sWAk0V41teb.jpg" /></figure><p>Then, <strong>try accessing your site</strong>. If the <strong>err_too_many_redirects</strong> is gone, the error was caused by the plugin which you just deactivated. However, if the error persists, you should <strong>repeat the same process for all plugins, one by one</strong>, until you find the faulty one. The testing process can also be done on a <a href="https://qodeinteractive.com/magazine/how-to-setup-wordpress-staging-site/">staging domain</a> if you are afraid of further endangering your live site. Nevertheless, it is important to be thorough in your testing. When you locate the faulty plugin, contact its developers for assistance.</p><h3>Recreate the .htaccess File</h3><p>The .htaccess file contains a lot of code that affects various server functionalities such as URL redirection, security settings, access restriction for certain IP addresses, and more. This makes it quite difficult to pinpoint the exact line of code that leads to the err_too_many_redirects. As such, it is much easier to delete the .htaccess file and create a new one with the default code, via FTP, and test the issue afterward.</p><p>The .htaccess file resides in the root WordPress directory, but it is often hidden. To access it, you should enable the option(s) for <a href="https://qodeinteractive.com/magazine/find-htaccess-file-on-wordpress-site/">showing hidden files</a> in your FTP client. We used FileZilla; the option you need is under the <strong>Server</strong> tab and it’s called <strong><em>Force showing hidden files</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*esA-9mzWQK1bi7c4.jpg" /></figure><p>After activating this option, <strong>connect to your server</strong> using your FTP credentials and navigate to your <strong>root WordPress directory</strong>. Locate the <strong>.htaccess</strong> file within. We advise you to rename the file instead of deleting it, as this will let you hold on to any code found in it. So, if the .htaccess isn’t causing the <strong>err_too_many_redirects</strong> error, you will get to keep any coding modifications you’ve previously made to the file. Therefore, <strong>right-click on it and select the Rename option</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TLxFcw5NMknOnVRr.jpg" /></figure><p><strong>Rename the file</strong> whatever you like (for example <strong>.htaccess_old</strong> or <strong>.htaccess_deactivated</strong>) and then create a new one. To create a new .htaccess file, login <strong>to your admin dashboard</strong>, navigate to <strong>Settings &gt; Permalinks</strong>, and <strong>click on the Save Changes button</strong> in the bottom left corner of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*wLDZy7jrLP9tjxtt.jpg" /></figure><p>This will automatically create a new .htaccess file. After that, <strong>check for the error</strong>. If the Too <em>Many Redirects</em> error is no longer present, the culprit was a piece of faulty code found in the old .htaccess file.</p><h3>Final Thoughts</h3><p>Now that you’ve seen how straightforward troubleshooting a Too <em>Many Redirects</em> error is, we hope you’ll never feel any sense of dread upon seeing this error message. Whether the redirect loop is caused by plugins, mismatched URLs, or corrupted .htaccess files, just follow the steps outlined in this guide and you will easily fix the error. Furthermore, since you now understand what the error is and when it can happen, you will be able to address it with confidence. And, should you need it, this article can always serve as a reference if you forget the specifics of any step for solving the <em>Too Many Redirects</em> error.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/err-too-many-redirects/"><em>https://qodeinteractive.com</em></a><em> on July 18, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59b76bdbc869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Eliminate Render-Blocking Resources — Qode Interactive]]></title>
            <link>https://medium.com/@sasa.stojanovic876/how-to-eliminate-render-blocking-resources-qode-interactive-d115a7ffee42?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/d115a7ffee42</guid>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Sat, 06 Jun 2020 13:00:17 GMT</pubDate>
            <atom:updated>2020-09-18T08:28:47.878Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Eliminate Render-Blocking Resources — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tnQ6I3ezHWDWohAG.jpg" /></figure><p>Website speed is one of the many things that affect your Google Search rankings. Also, since it dramatically impacts whether a visitor will stay on your site or not, it’s no wonder that website owners continuously strive to improve it. Some of the methods of improving your page loading speed include having a good web hosting service, using caching plugins, and eliminating render-blocking resources like JavaScript and CSS on your WordPress website. Therefore fixing render-blocking issues is quite important. Since knowing how to do that isn’t common, we prepared this article to explain what it means to have render-blocking resources and how to eliminate them. For easier navigation, we divided this article into several sections:</p><ul><li><a href="https://qodeinteractive.com/magazine/eliminate-render-blocking-resources/#testing-your-website">Testing your website</a></li><li><a href="https://qodeinteractive.com/magazine/eliminate-render-blocking-resources/#using-wordpress-plugins">Solving the issue using WordPress plugins</a></li><li><a href="https://qodeinteractive.com/magazine/eliminate-render-blocking-resources/#verifying-that-the-issue-is-solved">Verifying that the issue is solved</a></li></ul><h3>What It Means to Have Render-Blocking JavaScript and CSS Code</h3><p>When a user visits your website, their web browser will start to load the page from top to bottom. The upper section of the page, that is loaded and seen first, is called <strong>above the fold (ATF) content</strong>. If the browser comes across a CSS stylesheet or a JS script during the loading process it will pause the page loading in order to parse those resources, thus slowing the overall page load speed. Only the CSS stylesheets or JS scripts that are loaded while above the fold content is loading, but are considered non-relevant to its functioning, are the ones we call render-blocking. A solution to counteract this is to delay the loading of unnecessary resources. You can do this by loading your JS scripts, which are responsible for interactions and functionality rather than style, in the footer (before the closing &lt;/body&gt; tag). CSS stylesheets should still be loaded at the top (in the head section) in order to avoid the so-called <strong>flashes of unstyled content</strong> (FOUC). FOUC is a short moment where above the fold content is loaded with default browser stylization, which can look unappealing to visitors and cause them to turn away from your site.</p><p>Since all plugins and themes add both CSS and JS, some of which may be render-blocking, you need to tackle this issue as efficiently as possible. We’re going to introduce you to several plugins you can use to address render-blocking scripts and stylesheets. Additionally, we’re going to quickly cover what some of those plugins are doing behind the scenes so you can grasp what you need to do. <strong>The explanations might seem a bit complicated but are necessary in order to understand the options offered by certain plugins</strong>.</p><p>When it comes to the elimination of render-blocking JS scripts, one of the solutions is to add async or defer attributes to them. Async and defer achieve the same purpose — <strong>downloading JS scripts while parsing HTML content</strong>. The main difference between the two is that when using async the script is executed after it is loaded (by pausing the HTML parsing) whereas when using defer the scripts are executed after the HTML parsing is done. Both methods have their pros and cons. <strong>Defer is better suited for scripts with a dependency, as it preserves the order in which they are defined. Async is better suited for scripts without a dependency, as they are executed as soon as they are loaded</strong>. Additionally, before you employ either of those methods, make sure to exclude jquery.js as it needs to load with ATF content. <strong>Deferring or asynching jquery.js can result in your site breaking since there are scripts dependant on it running properly</strong>. Spamaller scripts can either be combined and then asynced/deferred or loaded inline with HTML.</p><p>When it comes to the elimination of render-blocking CSS stylesheets, the solutions include loading smaller CSS inline with HTML, use conditional CSS-specifying viewports and widths (with the use of media queries), and asynchronously loading the remaining stylesheets, which has become a common WordPress practice.</p><h3>How to Eliminate Render-Blocking JS and CSS Code</h3><p>You can use WordPress plugins to eliminate render-blocking resources. Depending on the extent of the issue, you can <strong>opt to use free or premium plugins</strong>. You could also <strong>eliminate render-blocking resources manually, but that requires a great deal of advanced WordPress knowledge</strong>, and, as such, we will focus on plugin-based solutions. <strong>Using plugins can make the process of removing render-blocking resources simple</strong>. It includes the following steps: testing the site to establish which resources are render-blocking, enabling the proper plugin options, and re-testing to verify if the issue is gone. If needed, the process can be repeated several times by testing additional plugin options to get the best results.</p><h4>Testing Your Website</h4><p>The first step of every successful troubleshooting attempt is finding the problem. Luckily, there are many good website-testing tools. We will take a look at two such websites — <a href="https://gtmetrix.com/">GTmetrix</a> and <a href="https://developers.google.com/speed/pagespeed/insights/">PageSpeed Insights</a>. Other options you can try include <a href="https://tools.pingdom.com/">Pingdom Speed Test</a>, <a href="https://www.webpagetest.org/">WebPage Test</a>, and <a href="https://tools.keycdn.com/speed">KeyCDN Website Speed Test</a>. Before we move on to testing, you should be aware that website-testing tools might crawl your site more slowly the first time. Because of that, they may end up showing higher page load times. Therefore, <strong>we suggest running several tests and using the average result as the yardstick</strong>.</p><p><strong>GTmetrix is a very detailed website-testing tool</strong> — it checks the PageSpeed and YSlow metrics and shows the waterfall visualization of your page load. If you register (which you can do for free) you also <strong>get access to page load timings, video playback of your loading process, as well as the history of previous tests you made</strong>. Additionally, while being logged-in, you get to edit analysis options. Those include the browser type (Chrome and Firefox), mobile testing (Galaxy Nexus, Android system using the Chrome browser), seven different locations to choose from, types of connection, and the use of an Adblock.</p><p>To test your site, visit the GTmetrix page, <strong>insert your URL</strong>, and click <strong>the <em>Test your site</em> button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*6GIrWfe7AoqFfz82.jpg" /></figure><p>By clicking on <strong>the <em>Page Speed</em> tab</strong> you can see all the recommendations and your current grade for each. To locate all render-blocking CSS and JS resources, check the relevant lines regarding inline code, minification, and optimization. <strong>We marked all the options you should look for in the screenshots below</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sE23BrFKmPkMF6wO.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*HYh-vs4XIq51wFAX.jpg" /></figure><p>In most cases, the last two options we marked (<strong>Put CSS in the document head</strong> and <strong>Prefer asynchronous resources</strong>) can be ignored. That is because both those options are currently default WordPress practice.</p><p><strong>If you click on any of the recommendations, it will show a list of resources that need to be improved</strong>. For our purposes, it will be <strong>a list of stylesheets or JS scripts</strong>. Also, hovering over <strong>the <em>What’s this mean?</em> button</strong> will show a small excerpt of an article clarifying the meaning of the recommendation, accompanied by <strong>a <em>Read more</em> link</strong> to the complete article for further explanation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CzyNs2v49oz7H6KF.jpg" /></figure><p><strong>You should save a list of the stylesheets and scripts you get in the results as it will be helpful in the steps to come.</strong></p><p>Another often-used website tool is the <strong>PageSpeed Insights</strong> website. PageSpeed Insights reviews your site — both the desktop and mobile versions — on a scale of 0–100. It reviews above-the-fold loading time as well as full-page loading time. Similar to GTmetrix, it provides suggestions for improving your website loading time. Moreover, it takes into account information from the <em>Chrome User Experience Report</em> to score your mobile website by considering the font and button sizes on mobile as well as the viewport configuration.</p><p>To test your site, visit PageSpeed Insights, <strong>insert your website URL</strong>, and press <strong>the <em>ANALYZE</em> button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*H92wijn5CV41af4e.jpg" /></figure><p>Navigate to <strong>the Opportunities section</strong> to see where you can make improvements to get a faster page load time. PageSpeed Insights offers a more concise report regarding the removal of render-blocking resources, shown in a single subsection. You only need to search for the <strong><em>Eliminate render-blocking resources</em></strong> subsection/tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SlbIl05KoJegwnrM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*wjc-yQXrLdNyqSPL.jpg" /></figure><p><strong>Clicking on it</strong> will open its content. There you will find a short explanation regarding render-blocking resources, including links to possibly helpful plugins. Most importantly, it contains <strong>the list of all render-blocking stylesheets and scripts</strong> which you will need later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mNQckFOPP8F0aCK4.jpg" /></figure><h4>Solving the Issue Using WordPress Plugins</h4><p>One of the many benefits of WordPress is the multitude of plugins for almost every purpose. Fixing render-blocking resources is no exception, so we turn to caching and site-optimization plugins for help. However, before you proceed, we strongly advise you to make <a href="https://qodeinteractive.com/magazine/how-to-manually-backup-wordpress-website/">a backup of your site</a>. Removing or changing the order at which some resources are loaded in order to prevent them from being render-blocking could negatively impact your website or, more precisely, break your theme. So make sure you have a backup ready just in case, and then we can move on to the main section of this article. We will take a look at two plugins — <a href="https://wordpress.org/plugins/w3-total-cache/">W3 Total Cache</a> and <a href="https://wordpress.org/plugins/wp-fastest-cache/">WP Fastest Cache</a>, and give you some additional suggestions and alternatives in the section afterward.</p><ul><li><strong>W3 Total Cache</strong></li></ul><p>After you <a href="https://qodeinteractive.com/magazine/how-to-install-a-wordpress-plugin/">install and activate the plugin</a>, navigate to the <strong>Performance tab</strong> in your dashboard and click on the <strong>General Settings</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5TvUIcnTTnho-Af_.jpg" /></figure><p>Under <strong>the Minify section tick to <em>Enable</em></strong>. Select <strong><em>Auto</em> under Minify mode</strong> and then <strong><em>Save all settings</em></strong> below. Finally, click <strong>the <em>Save Settings &amp; Purge Caches</em> button</strong> on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DdDw7dGtAFYaihaj.jpg" /></figure><p>If you want to have additional control over which stylesheets and JS scripts get minified, you can <strong>select <em>Manual</em> under Minify mode</strong>. However, we advise against using manual minification unless you are a more advanced WordPress user or have someone to guide you through it. If you still want to try manual minification of JS scripts, then you should navigate to <strong>Performance &gt; Minify</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UpGmee7G_DNr-gUc.jpg" /></figure><p>Then locate <strong>the JS section</strong>. <strong>Tick the checkbox next to <em>Enable</em></strong> and choose <strong>your embed type</strong> (we suggest <em>Non-blocking using async</em> or <em>Non-blocking using defer types</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*nT2PZEq-cmoljJz8.jpg" /></figure><p>Next, select <strong>your active theme</strong> and start adding the JS scripts by clicking <strong>the <em>Add a script</em> button</strong>. To add a script, insert its <strong>file URL</strong> and select its <strong>embed location</strong>. The URLs are the ones you got in the previous step, either by using GTMetrix or Page Speed Insights. And the embed location for JS scripts should be before the closing &lt;/body&gt; tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bwFF051WVQ6-41lf.jpg" /></figure><p>Similarly, to minify stylesheets, scroll down to <strong>the CSS section</strong>, located in <strong>Performance &gt; Minify</strong>, and tick <strong>the checkbox next to the <em>Enable</em> option</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Z4Q9W_OU_V_YPFud.jpg" /></figure><p>Choose <strong>your active theme</strong> and click on <strong>the <em>Add a style</em> sheet button</strong>. After you are done adding the stylesheets you need, click on <strong>the <em>Save all</em> settings button</strong> below. Afterward, click on <strong>the <em>Save Settings &amp; Purge Caches</em> button</strong> on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*N9t0K0425DqoLP12.jpg" /></figure><ul><li><strong>WP Fastest Cache</strong></li></ul><p>After you install and activate the plugin, open <strong>the <em>WP Fastest Cache</em> option</strong> in your admin dashboard menu.</p><p>Click on <strong>the <em>Settings</em> tab</strong> and tick all the options regarding the minification and combining of CSS and JS. Those are <strong>Minify Css</strong>, <strong>Combine Css</strong>, and <strong>Combine Js</strong>. However, please note that you need to buy the premium version of this plugin to get access to its more powerful options for fixing render-blocking. Those premium options include <strong>Minify Css Plus</strong>, <strong>Minify Js</strong>, <strong>Combine Js Plus</strong>, <strong>Render Blocking Js</strong>, and the <strong>Google Fonts option</strong> (for asynchronous load). Once you’ve selected the options you need, simply <strong>go to Submit to finish up</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*khXyQGDlmEz1xAw1.jpg" /></figure><h4>Verifying That the Issue Is Solved</h4><p>After your plugin of choice completes elimination of render-blocking scripts and stylesheets, you should run another test of your website using the website(s) mentioned before. Make sure to clear both plugin and browser cache beforehand. Also, we suggest waiting a couple of minutes before running the test. Then, you can <strong>check your website using one of the website-testing tools</strong>. If you aren’t sure how to re-test your site, you can repeat the same process described under <strong><em>Testing your website</em></strong>. Make sure to run the test using the same tool, in order to be able to compare results. For our new test-run, we got the following results.</p><p><strong>GTmetrix results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*qWFB8eoIdNrmsy8q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5rkDdI-b9ysE42-W.png" /></figure><p><strong>PageSpeed Insights results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1jANkOnTVv_mZGyt.jpg" /></figure><p>As you can see, the results are very close to being perfect but aren’t there yet. Sometimes, this means you should run through another fix using a different plugin but, it’s more likely that you need to take the result with a grain of salt. It’s important to note that the recommendations given by website-testing tools are simply guidelines, and shouldn’t be followed blindly. <strong>You shouldn’t strive to achieve a perfect score at the cost of removing an essential JS script required for a robust WordPress website to work properly</strong>. For example, because you excluded jquery.js, you won’t get a perfect score, but that was necessary to ensure that all scripts (and by extension, your site) that rely on it are running smoothly.</p><h4>Other Helpful WordPress Plugins</h4><p>If you aren’t satisfied with the test results you got after your first fix, you can try using another caching or page optimization plugin. You can also consider finding a developer for further help. As with all plugins, conflicts can happen, so you should check the compatibility before adding a new one. In case of conflicts, contact the plugin authors for guidance.</p><p>We will take a look at two more plugins — <a href="https://wordpress.org/plugins/autoptimize/">Autoptimize</a> and <a href="https://wordpress.org/plugins/async-javascript/">Async JavaScript</a>. They are both free, designed by the same author, and often used in conjunction to optimize websites and remove any render-blocking resources. Autoptimize can minify both scripts and stylesheets, aggregate them, and inline both JS and CSS. However, Async Javascript is only useful for optimizing JS scripts. It gives you direct control over which scripts are asynced, deferred, or excluded.</p><p><strong>Autoptimize</strong></p><p>After installing the plugin, navigate to <strong>Settings &gt; Autoptimize</strong> and click on <strong>the <em>JS</em>, <em>CSS</em> &amp; <em>HTML</em> tab</strong>. You can significantly improve the impact of render-blocking JS and CSS code simply by checking the default <strong><em>Optimize JavaScript Code?</em> and <em>Optimize CSS Code</em>? options</strong>. Also, you can tick the checkbox next to<strong> the <em>Also aggregate inline JS?</em> and <em>Also aggregate inline CSS?</em> options</strong> to fix additional render-blocking JS and CSS files. However, unless you are an advanced WordPress user, we advise sticking to the default options for optimizing the JS and CSS code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kZy5Kh89KrGD4-Gt.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*4ngy0_XUTE3OcZc5.jpg" /></figure><p><strong>Async JavaScript</strong></p><p>After installing the plugin, navigate to <strong>Settings &gt; Async JavaScript</strong> and click on <strong>the <em>Settings</em> tab</strong>. Tick the checkbox next to <strong>the <em>Enable Async JavaScript?</em> option</strong> and choose either <strong>the <em>Apply Async</em> or the <em>Apply Defer</em> option</strong> from <strong>the <em>Quick Settings</em> section. If the <em>Apply Async</em> option causes issues to your website, try excluding jQuery (click on the radio button next to <em>Exclude</em> in the jQuery section) or simply choose the <em>Apply Defer</em> option</strong>. Using this plugin, you can choose which scripts to async and which to defer by manually adding them. Also, this plugin offers the option to exclude scripts from the async/defer process. This is true for both single scripts and those contained within a plugin or theme. While this plugin has its uses, it’s geared towards advanced WordPress users, so it would be best for developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9V_g0hW_17xQ8pvv.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*g8q5CC5ImILeO9NR.jpg" /></figure><h3>Final Thoughts</h3><p>Render-blocking scripts and stylesheets can have a significant impact on the speed of your site, so it’s important that you learn how to address them. In this article, we have taken a look at what it means to have render-blocking JavaScript and CSS code, how it loads, and some of the plugins you can use to eliminate render-loading resources. The plugins we chose include advanced website-optimization options that will help you shave down your load time. So, your site will be ready to rise in search engine rankings.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/eliminate-render-blocking-resources/"><em>https://qodeinteractive.com</em></a><em> on June 6, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d115a7ffee42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixes for the 404 Not Found WordPress Error — Qode Interactive]]></title>
            <link>https://medium.com/qodeinteractive/fixes-for-the-404-not-found-wordpress-error-qode-interactive-41c73dc6f1d1?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/41c73dc6f1d1</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[404]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Sat, 04 Apr 2020 13:00:52 GMT</pubDate>
            <atom:updated>2020-10-20T12:40:50.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fixes for the 404 Not Found WordPress Error — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pa0seslfVpVnXxWe.jpg" /></figure><p><strong>One of the most common issues</strong> that appear for WordPress websites is the 404 Not Found WordPress error. Luckily, <strong>it is fairly easy to solve</strong> compared to the other WordPress errors. It’s rarely a sign of a serious problem, but it can still have a negative effect on user experience. The error <strong>can happen during access to theme assets (images, CSS or JS files) and pages</strong>. Most often, it shows up on WordPress posts. The error message can vary but usually includes the following phrases: <strong>not found, can’t find, Error 404 or just 404</strong>.</p><p>In this article, we will guide you through the solutions that are known to help with this error. They aren’t restricted to posts only — you can apply them in any situation when the 404 Error occurs.</p><p>Small tip before we begin: since 404 Errors are virtually impossible to avoid, <strong>it is also important to improve the user experience when they happen</strong>. You can do this by customizing the look of your 404 Error page. Some themes, like the ones we provide at <a href="https://qodeinteractive.com/">Qode Interactive</a>, offer these customization options, while others require the use of third-party plugins.</p><p>Here’s an example of a customized 404 page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*YskHNYsgevEYzwzc.jpg" /></figure><p>In this article, we’ll cover the following troubleshooting options:</p><ul><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Removing-invalid-links">Removing invalid links</a></li><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Removing-typos">Removing typos</a></li><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Clearing-the-cache">Clearing the cache</a></li><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Saving-permalinks">Saving permalinks</a></li><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Making-default-htaccess-file">Making a default .htaccess file</a></li><li><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/#Additional-troubleshooting-steps">Additional troubleshooting steps</a></li></ul><h3>Preliminary Steps</h3><p>Before you look for the cause of the issue, <strong>make sure the error wasn’t only temporary</strong>. While it may seem needless, we strongly recommend you take these preliminary steps before delving into more complicated ways to deal with the 404 Error.</p><h3>Removing Invalid Links</h3><p>Occasionally, an <strong>admin user or site editor delete an article and move its content elsewhere, but forget to remove the broken link from the menu of the site</strong>. This is one of the more common causes of the 404 Error. In this case, all it takes is removing or editing the menu links that lead to non-existent posts. Do the same with the broken page URLs.</p><p>To remove invalid links, navigate to <em>Appearance &gt; Menus</em> and select the menu currently in use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*0rReg6TlsSm-sFJg.jpg" /></figure><p>Find the invalid menu item and <strong>delete it</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*4HukkHe9YJ8HTaqF.jpg" /></figure><p>Click on <em>Save Menu</em> to save the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*U_MwVCu1uv7zngOc.jpg" /></figure><p>Afterward, you can add a new menu link with the proper URL and <strong>drag it to the desired location within the menu</strong>.</p><h3>Removing Typos</h3><p>Typos are another common cause of error 404. <strong>Make sure that the page/post URL is correctly typed</strong>, especially if you are typing it manually. For example, inserting your-site-name/blof instead of your-site-name/blog can cause the error, so make sure to check carefully.</p><h3>Clearing the Cache</h3><p>With browser-related troubleshooting, it is also recommended to <strong>make sure that the error isn’t caused by caching</strong>. Clear the browser cache and try accessing the page, post or theme asset once more. You can also access it in another browser or an incognito window inside of your current browser.</p><h3>Solving the Error</h3><p>With browser-related troubleshooting, it is also recommended to <strong>make sure that the error isn’t caused by caching</strong>. Clear the browser cache and try accessing the page, post or theme asset once more. You can also access it in another browser or an incognito window inside of your current browser.</p><p>Also, <a href="https://qodeinteractive.com/magazine/how-to-manually-backup-wordpress-website/">create a backup of your WordPress site</a>. If you don’t feel comfortable doing it yourself, ask your hosting provider to do it for you.</p><h3>Saving Permalinks</h3><p>If the 404 Error is present on the entire site, it is likely caused by a permalink issue. On WordPress posts, it happens when you click to view a post. This can be quite frustrating, especially after you’ve just created a post and added all the content.</p><p>If you are experiencing this issue, don’t worry. Your post is still there and all you need to do is <strong>update your permalinks</strong>. Navigate to <em>Settings &gt; Permalinks</em> and click on <em>Save Changes</em> in the lower-left corner of your screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*HxmfvkAj3G4bVVLI.jpg" /></figure><p>The issue with viewing the posts is most often caused by the changes in the permalink slug of a <a href="https://developer.wordpress.org/themes/basics/post-types/#custom-post-types">custom post type</a>. Most premium themes, apart from <a href="https://developer.wordpress.org/themes/basics/post-types/#default-post-types">default post types</a>, offer their own post types. They also might include the option to change the permalink slug of that custom post type.</p><p>Qode Interactive themes offer this option. The option included within these themes has a note that states: <em>After entering slug, navigate to Settings &gt; Permalinks and click on Save in order for changes to take effect</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*DCj2Vsgkqfy790Iu.jpg" /></figure><p>Using a plugin to change the permalink slug of a custom post type is also a common cause of the issue, especially for themes that lack the permalink options. <strong>If you are using this type of plugin, make sure to update your permalink settings after changing the slug</strong>.</p><h3>Making a Default .htaccess File</h3><p>Another way to solve the 404 Error is to <strong>manually edit the <em>.htaccess</em> file</strong>. This solution requires an FTP client like FileZilla and the knowledge of <a href="https://qodeinteractive.com/magazine/how-to-use-ftp/">editing files via FTP</a>.</p><p>As the .htaccess file is a hidden server configuration file, you need to <strong>enable viewing hidden files in the chosen FTP client</strong>. To do this in FileZilla, navigate to the Server tab and click on <em>Force showing hidden files</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MiBSUD0tqteYSA2n.jpg" /></figure><p>After setting the options, go to the root directory of your WordPress site, find the .htaccess file, right-click on it and select <em>View/Edit</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*7aWVCY2dJ3LnweeX.jpg" /></figure><p>Before the edits, <strong>download the file and save that version as a backup on your computer</strong>. You can see the download option on the screenshot.</p><p>To restore the default .htaccess file, <strong>add the following code and save the file</strong>. Upload it to the server, overwriting the one that’s currently there.</p><pre># BEGIN WordPress</pre><pre>&lt;IfModule mod_rewrite.c&gt;</pre><pre>RewriteEngine On</pre><pre>RewriteBase /</pre><pre>RewriteRule ^index\.php$ — [L]</pre><pre>RewriteCond %{REQUEST_FILENAME} !-f</pre><pre>RewriteCond %{REQUEST_FILENAME} !-d</pre><pre>RewriteRule . /index.php [L]</pre><pre>&lt;/IfModule&gt;</pre><pre># END WordPress</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*DevHIUMD2D5BDfwk.jpg" /></figure><p><strong>Run a test</strong> to see if the error is resolved. If it isn’t, <strong>re-upload the stored backup version of the file</strong>.</p><p>If you have trouble implementing this solution due to insufficient file permissions, you can <strong>temporarily change the permission of the .htaccess file to 666</strong>. Do it by right-clicking on the .htaccess file, from your chosen FTP client, and selecting <em>File permissions</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*GipniH9lnoCIxiYO.jpg" /></figure><p>Afterward, manually insert 666 in the numeric value box and press <em>OK</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*9OVjjGA15zqkcqrK.jpg" /></figure><p>Having changed the file permission, <strong>restore the default .htaccess file as we previously described</strong>.</p><p>When you’re done, <strong>revert the permission of the .htaccess file to the old value</strong>, which can be 644 or 660.</p><h3>Additional Troubleshooting Steps</h3><p>On rare occasions, none of the solutions we described will solve the issue. For those cases, here are <strong>2 additional steps known to successfully troubleshoot</strong> general WordPress errors.</p><h3>Disabling mod_security</h3><p>Mod_security is an open-source software used for site protection and access-control. This is achieved using certain rulesets, namely ModSecurity Core Rule Set or self-made rulesets.</p><p>However, mod_security rules are known to give quite a few false positives regarding the daily use of a WordPress site. Therefore, <strong>you need to make certain ruleset exclusions</strong>. This can be difficult if you are implementing numerous rules, so the best way to deal with this issue is to temporarily disable the mod_security altogether.</p><p>This can be done by <strong>editing your .htaccess file via FTP</strong>. Add the following code at the top of your .htaccess file.</p><pre>&lt;IfModule mod_security.c&gt;</pre><pre>SecFilterEngine Off</pre><pre>SecFilterScanPOST Off</pre><pre>&lt;/IfModule&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*U6k5i2yyPr7x4RFu.jpg" /></figure><p>Afterward, test if the issue is resolved. If not, remove the code to avoid creating security issues.</p><h3>Disabling Plugins and Theme</h3><p>As it is important to be thorough, testing your plugins and theme should be included in every troubleshooting process. <strong>Deactivate your plugins one by one</strong>. After each deactivation, try to access the page, post or theme asset.</p><p>If the error is resolved, the last deactivated plugin is the culprit.</p><p>If you skipped backing up your site at the beginning of troubleshooting, don’t skip it at this point. Continue by <strong>switching your theme to a default one</strong> (e.g., Twenty Twenty) and run the test. If the error disappears, then your theme is the source of the problem. In that case, contact the theme’s customer support for further assistance.</p><h3>Final Thoughts</h3><p>Apart from solving your problem, you had an opportunity to learn how your website works. Keep this tutorial on how to fix 404 Not Found WordPress errors in your bookmarks, since you’ll likely run into the error again. Be fully prepared when it happens next time!</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/404-not-found-wordpress-error/"><em>https://qodeinteractive.com</em></a><em> on April 4, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41c73dc6f1d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qodeinteractive/fixes-for-the-404-not-found-wordpress-error-qode-interactive-41c73dc6f1d1">Fixes for the 404 Not Found WordPress Error — Qode Interactive</a> was originally published in <a href="https://medium.com/qodeinteractive">Qode Interactive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Custom JavaScript to Your WordPress Website — Qode Interactive]]></title>
            <link>https://medium.com/qodeinteractive/how-to-add-custom-javascript-to-your-wordpress-website-qode-interactive-1af90c4d4529?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/1af90c4d4529</guid>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 14:00:19 GMT</pubDate>
            <atom:updated>2020-12-01T15:43:48.004Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Add Custom JavaScript to Your WordPress Website — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lyuoJdWn68gUpbE5.jpg" /></figure><p>JavaScript code can be added to your WordPress website for various purposes, usually to improve a feature or add functionality. Regardless of the reason you’re adding JavaScript (JS) to your website, it is important to properly create, place and keep up this code. Incorrect code placement can hurt the site’s performance or even break it.</p><p>In this article, we will show you several ways to add the JavaScript code. Let’s begin!</p><h3>Theme Options</h3><p>Some WordPress themes incorporate a field for including JS code. To see if that’s the case with your website theme, review its available options. If the option exists, insert the JS code in the designated place, if it exists.</p><p>For example, all WordPress themes created by <a href="https://qodeinteractive.com/">Qode Interactive</a> allow you to insert JS code in the theme settings. You can access them by navigating to Theme_name Options &gt; General. Scroll down to the section called Custom Code and insert your JS code in the Custom JS field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*wsqP1VZZTWX8Pvzp.jpg" /></figure><h3>Using Plugins</h3><p>One of the many benefits of WordPress is a wide array of available plugins for just about any functionality you can think of. Therefore, adding JS code to your WordPress site can be as simple as finding the plugin that best suits your needs.</p><p>JavaScript plugins can be free, premium, or even come bundled with the themes. In this article, we will cover several examples of these plugins, but if they don’t seem like the right fit, you are free to explore beyond this list.</p><h4>Plugin Shortcodes</h4><p>Some plugins, like WPBakery Page Builder, have shortcodes for adding JS to individual pages and posts. In WPBakery, this shortcode is called Raw JS.</p><p>If you don’t have this plugin, first you have to install it and activate it. Then, go to the backend of a page or a post, and click on “Add Element”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*jTkWkqzLgQ67PrwD.jpg" /></figure><p>Search for “Raw JS” and click to add the shortcode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*yckda_TAbEmt4sQe.jpg" /></figure><p>The only thing left to do is add the code within the shortcode. By creating the shortcode, you also create a dummy JS code. Add your code between the opening &lt;script&gt; tag and closing &lt;/script&gt; tag.</p><p>If you delete the dummy JS code, you have to make sure that the code you insert has both the opening &lt;script&gt; and the closing &lt;/script&gt; tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*W90pi7B1H-VltbkM.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*HWalK2H_03m1ae2e.jpg" /></figure><p>If you are using this method to add JavaScript to your website, it is strongly recommended that you add JS code that is smaller in size. Otherwise, the page loading speed could decrease. If you want to include larger JS code, consider using a different method.</p><h4>Plugin Options</h4><p>Most plugins offer options for including JS code. Depending on the plugin, this code can be applied site-wide, or be page-specific. In this section, we will describe the Insert Headers and Footers plugin, as it is a widely recommended solution.</p><p>This plugin is used to implement site-wide JS code, although the code can be adjusted for specific pages or posts only. For the purposes of this guide, we will focus on the site-wide code, since the intricacies of additional code adjustments warrant a separate article.</p><p>One example of popular site-wide code is the Google Analytics code. To install the plugin, navigate to Plugins, click on “Add New” and type a keyword (“Headers”, for example) in the search bar. Click on the result, install it, and don’t forget to activate it — the installed plugin won’t work unless it is activated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*dRcRXot7sZfgIE0A.jpg" /></figure><p>To use the plugin, go to Settings, click on Headers and Footers, and insert your code either in the Scripts in the Header or Scripts in the Footer section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*TEkbCYO-0OXnM0mA.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*A0e8ixfm_tr6l9p0.jpg" /></figure><p>Here’s another tip: inside the Scripts in the Header field, include the code that is a part of the &lt;head&gt; section and applied site-wide. This includes Google Analytics code, stylesheets or code concerning &lt;meta&gt; tags, for example. The rest should be placed in the “Scripts in Footer” section, especially if the JS code is adjusted to be page-specific.</p><p>However, if the code isn’t working when you add it to the first section, try to remove it and add it to the second section.</p><p>Another way to add JS code is to add it directly to the appropriate section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*v6vPOLaW6PI25MT3.jpg" /></figure><p>If you have larger JS scripts, you can create a stylesheet (a file with a .js extension), upload it to the dedicated JS folder inside your theme and include its path. The path will most likely be one of the following two:</p><p>wp-content/themes/theme_name/js</p><p>or</p><p>wp-content/themes/theme_name/assets/js</p><p>Add the line of code with the path to the uploaded file. Depending on the path, the src attribute will vary. Here are two possible examples:</p><pre>&lt;script src=”your_website_url/wp-content/themes/theme_name&gt;/js/filename.js”&gt;&lt;/script&gt;</pre><p>or</p><pre>&lt;script src=”your_website_url/wp-content/themes/theme_name&gt;/assets/js/filename.js”&gt;&lt;/script&gt;</pre><p>When you use this line, the entire code from the uploaded file will be loaded when the script is run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*Pwv3DFyBYzl-FQeM.jpg" /></figure><p>Make sure the code you add has both the opening &lt;script&gt; and the closing &lt;/script&gt; tag.</p><p>Always check your site thoroughly after adding the JS code. Although JavaScript code can improve the functionality of certain pages, it can harm others by overlooking the outlying cases.</p><p>If you don’t think this plugin is the right fit for you, we encourage you to explore the <a href="https://wordpress.org/plugins/">WordPress.org plugins page</a> or tell us about your experiences with JS inclusion plugins in the comments.</p><p>Now let’s move onto more coding-focused solutions. These will require a somewhat deeper understanding of WordPress, so they are a good choice for developers. If you want to give them a try despite not being WordPress savvy, try doing some additional research to prepare.</p><h3>More Advanced Methods</h3><p>Before we show you coding solutions for JavaScript, we will address some bad coding practices and habits you should avoid.</p><p>One bad practice you should avoid at all costs is directly adding JS code inside your theme’s header.php and footer.php files. This also extends to the file path inclusion of a certain uploaded JS file, both inside header.php, and footer.php.</p><p>Why is this such a bad idea? Whenever your theme is updated, your code will be lost during the all-encompassing override of the theme files. There are ways to avoid this by copying header.php and footer.php files inside a child theme.</p><p>However, it can still lead to conflicts with the plugin-loaded JS scripts, which is precisely why this method is not recommended. Now let’s look into the right ways to add JavaScript to your WordPress website.</p><h4>Using wp_head and wp_footer Hooks</h4><p>A method that is less encouraged, but still better than directly including the code, is adding the code using the wp_head and wp_footer <a href="https://developer.wordpress.org/plugins/hooks/">hooks</a>. Hooks are a way of changing the default behavior of themes, plugins, and WordPress, without changing its template files.</p><p>You can add the code both inside the theme and plugins, created specifically for your site. We recommend you use the functions.php of your child theme, so you can preserve the changes after theme updates. Another suggestion — add smaller JS code scripts.</p><p>Why is this method not encouraged? While it may seem effective at first, adding too much code can easily become hard to keep up with. Furthermore, it can cause certain scripts to load multiple times, decreasing the speed of your website. So, this method will serve you well only with careful and limited use.</p><p>If you are sure you want to add JavaScript this way, simply insert one of these 2 blocks of code inside your functions.php (or functions.php of your child theme), depending on whether you want to hook onto wp_head or wp_footer.</p><pre><strong>function</strong> my_javascript_code() {</pre><pre>?&gt;</pre><pre>&lt;script&gt;</pre><pre>// your javascript code goes here</pre><pre>&lt;/script&gt;</pre><pre>&lt;?php</pre><pre>}</pre><pre>add_action(‘wp_head’, ‘my_javascript_code’);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*IA3poYxpZVJOy-pr.jpg" /></figure><pre><strong>function</strong> my_footer_javascript_code() {</pre><pre>?&gt;</pre><pre>&lt;script&gt;</pre><pre>// your javascript code goes here</pre><pre>&lt;/script&gt;</pre><pre>&lt;?php</pre><pre>}</pre><pre>add_action(‘wp_footer’, ‘my_footer_javascript_code’);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ecY0eD4Mcig9Su3m.jpg" /></figure><p>It is also possible to apply the JS code selectively, using <a href="https://codex.wordpress.org/Conditional_Tags">WordPress conditional tags</a>.</p><p>We will include two possible examples:</p><ul><li>page-specific code, for a page called “About Us” and</li></ul><pre><strong>function</strong> about_us_javascript_code() {</pre><pre><strong>if</strong> ( is_page( ‘About Us’ ) ) { ?&gt;</pre><pre>&lt;script&gt;</pre><pre>// your javascript code goes here</pre><pre>&lt;/script&gt;</pre><pre>&lt;?php }</pre><pre>}</pre><pre>add_action( ‘wp_head’, ‘about_us_javascript_code’ );</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*2TjejvqrkOeVJESo.jpg" /></figure><ul><li>post-specific code, for the post with the ID of 30.</li></ul><p><strong>function</strong> my_post_javascript_code() {</p><pre><strong>if</strong> ( is_single( ‘30’ ) ) { ?&gt;</pre><pre>&lt;script&gt;</pre><pre>// your javascript code goes here</pre><pre>&lt;/script&gt;</pre><pre>&lt;?php }</pre><pre>}</pre><pre>add_action( ‘wp_head’, ‘my_post_javascript_code’ );</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*oK5Vorr8rd-Rqgqg.jpg" /></figure><p>The ID’s of the posts are visible when you’re editing. The ID number is located within the URL after the “post=” part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*TLhWvbtO0kJgsy0C.jpg" /></figure><p>Needless to say, it is important to take care of the proper code syntax in the opening and closing tags, both for PHP and JavaScript.</p><p>Similar codes can be created and “hooked onto” wp_footer hook. Wp_head hook is located before the closing of the &lt;/head&gt; tag, while the wp_footer is located before the closing of the &lt;/body&gt; tag. We recommend that you hook the code onto the wp_footer hook to avoid decreased loading speeds of your website, especially if the code is larger in length.</p><h4>Using wp_enqueue_script</h4><p>The most effective method of adding JavaScript code to your WordPress site is creating a separate .js file, inserting it in the proper place and then using the <a href="https://developer.wordpress.org/reference/functions/wp_enqueue_script/">wp_enqueue_script</a> function.<br>More precisely, this means you’ll add wp_enqueue_script to another function that is hooked to one of the two WordPress script loading hooks — wp_enqueue_scripts.</p><p>This method is preferred by developers of any well-coded theme. It bypasses the downsides of the previously described methods, such as plugin conflicts and loading the same script multiple times. Also, WordPress offers a <a href="https://developer.wordpress.org/themes/basics/including-css-javascript/#default-scripts-included-and-registered-by-wordpress">list of registered, widely used scripts</a>, in order to improve this process even further.</p><p>Similarly to the method we described in the previous section, this method requires the following:</p><ul><li>Creating a file with the .js extension</li><li>Placing the file in the designated place within the theme or plugin</li><li>Proper use of the wp_enqueue_script function</li></ul><p>We will clarify things by explaining some of the possible uses of this function.</p><p>As noted in the description, the wp_enqueue_script function has 5 parameters. Out of these five parameters, only the first one is required. That is the unique handle name.</p><ul><li>The code you can see below enqueues a script with the handle “dev-script”. The path to the file is wp-content/themes/theme_name/js/devscript.js.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*460qWrjsARWOiUWO.jpg" /></figure><p>The remaining parameters are set to default values. This means the function has no dependent scripts, its version is the same as the currently installed WordPress version, and it is enqueued before the closing of the &lt;/head&gt; tag.</p><p>The code should be placed inside the functions.php file of your (parent) theme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*zpeCKw19zK_RXpdp.jpg" /></figure><pre><strong>function</strong> my_dev_script() {</pre><pre>wp_enqueue_script( ‘dev-script’, get_template_directory_uri() . ‘/js/devscript.js’);</pre><pre>}</pre><pre>add_action(‘wp_enqueue_scripts’, ‘my_dev_script’);</pre><ul><li>Script enqueued bellow has the handle “appear”, while the path to the file is wp-content/themes/child_theme_name/assets/js/ jquery.appear.js. The function is dependent on the script with the handle “jquery”. Its version is the same as the currently installed WordPress version and it is enqueued before the closing tag.</li></ul><p>The code should be placed inside the functions.php file of your child theme.</p><pre><strong>function</strong> js_appear_script{</pre><pre>wp_enqueue_script( ‘appear’, get_stylesheet_directory_uri() . ‘/assets /js/ jquery.appear.js’, <strong>array</strong>( ‘jquery’ ), <strong>false</strong>, <strong>true</strong> );</pre><pre>}</pre><pre>add_action(‘wp_enqueue_scripts’,’js_appear_script’);</pre><ul><li>Script handle is “very-compatible”, path to the file is wp-content/plugins/plugin_name/’assets/js/compatible.js. The function has no dependent scripts, its version is 3.5 and it is enqueued before the closing &lt;/body&gt; tag.</li></ul><p>The code should be placed in one of the files of your plugin. The same plugin where you previously inserted the .js file.</p><pre><strong>function</strong> my_compatible_script() {</pre><pre>wp_enqueue_script(‘very-compatible’, plugins_url(https://medium.com/%E2%80%98assets/js/compatible.js%E2%80%99,%20__FILE__), <strong>array</strong>(), ‘3.5’, <strong>true</strong>);</pre><pre>}</pre><pre>add_action(‘wp_enqueue_scripts’,’my_compatible_script’);</pre><ul><li>The code below first registers the script with wp_register_script function and then enqueues.</li></ul><p>The wp_register_script function has the same parameters as the wp_enqueue_script, so it doesn’t require additional explanation. Given all the parameters, the wp_enqueue_script function already registers the JS script, which is why using the wp_register_script is not necessary.</p><p>However, the main benefit of using both functions is that the same script can be de-registered using <a href="https://developer.wordpress.org/reference/functions/wp_deregister_script/">wp_deregister_script</a>, and then re-registered with the same handle and different remaining parameters.</p><pre><strong>function</strong> register_and_add_script() {</pre><pre>wp_register_script(‘my-js-script’, get_template_directory_uri() . ‘/assets/js/my_js_script.js’, <strong>array</strong>(‘jquery’),’3.4.1&#39;, <strong>true</strong>);</pre><pre>wp_enqueue_script(‘my-js-script’);</pre><pre>}</pre><pre>add_action( ‘wp_enqueue_scripts’, ‘register_and_add_script’ );</pre><h4>Using wp_add_inline_script</h4><p>This method of adding JS code is best used in conjunction with the previously described method. While using wp_enqueue_script is better suited for adding large scripts, the wp_add_inline_script is the best choice for smaller JS code inclusions.</p><p><a href="https://developer.wordpress.org/reference/functions/wp_add_inline_script/">Wp_add_inline_script</a> function adds the JS code to an already registered script, either at the beginning or at the end. Therefore, the steps are as follows:</p><ul><li>Using wp_enqueue_script</li><li>Placing the file in the designated folder</li><li>Creating the .js file</li><li>Using wp_add_inline_script</li></ul><p>Both of the functions should be used within a function that “hooks” on to wp_enqueue_scripts.</p><p>Here’s one example of this type of function. It should be placed inside the functions.php of the (parent) theme.</p><pre><strong>function</strong> inline_custom_js() {</pre><pre>wp_enqueue_script( ‘theme-js-script’, get_template_directory_uri() . ‘/js/modules.js’, <strong>array</strong>( ‘jquery’ ), <strong>false</strong>, <strong>true</strong> );</pre><pre><strong>$custom_js</strong> = ‘insert-your-inline-javascript-here’;</pre><pre><strong>if</strong> ( ! <strong>empty</strong>( <strong>$custom_js</strong> ) ) {</pre><pre>wp_add_inline_script( ‘theme-js-script’, <strong>$custom_js</strong> );</pre><pre>}</pre><pre>}</pre><pre>add_action( ‘wp_enqueue_scripts’, ‘inline_custom_js’ );</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*c8b7aVkdg5FG5-v7.jpg" /></figure><h3>Final Thoughts</h3><p>In this guide on JavaScript code inclusion in WordPress, we tried to cover all the levels of difficulty and efficiency. We’ve also given you an opportunity to weigh the pros and cons of each method.</p><p>Depending on your needs and knowledge, you can find the method that suits you the best. You can also use this tutorial to learn something new and get to know your WordPress website a little bit better.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/add-custom-javascript-to-wordpress/"><em>https://qodeinteractive.com</em></a><em> on March 24, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1af90c4d4529" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qodeinteractive/how-to-add-custom-javascript-to-your-wordpress-website-qode-interactive-1af90c4d4529">How to Add Custom JavaScript to Your WordPress Website — Qode Interactive</a> was originally published in <a href="https://medium.com/qodeinteractive">Qode Interactive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix the Image Upload HTTP Error in Wordpress — Qode Interactive]]></title>
            <link>https://medium.com/@sasa.stojanovic876/how-to-fix-the-image-upload-http-error-in-wordpress-qode-interactive-28695a5be7a?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/28695a5be7a</guid>
            <category><![CDATA[image-upload]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 14:00:16 GMT</pubDate>
            <atom:updated>2020-09-21T08:02:29.426Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to fix the Image Upload HTTP Error in Wordpress — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QR1VG3jc3knYxiqB.jpg" /></figure><p>You know the old saying — one picture is worth a thousand words. The explanation for this is less poetic than the saying, but fascinating nevertheless. <strong>Compared to words, images are processed by our brain at a faster rate, so they can easily convey a multitude of information</strong>, including highly abstract ideas. On websites, images tell stories, complement your content, create the atmosphere and define your brand.</p><p>So, it is not hard to see why being unable to upload images is the nightmare of every website admin. Moreover, <strong>reading a vague and unhelpful message such as “HTTP error” can make the whole problem even more frustrating</strong>.</p><p>In this article, we will guide you through the various causes and methods of tackling the HTTP error that occurs when uploading images in WordPress. You can also use these methods if you’re getting this error when uploading videos, PDF and any other <a href="https://codex.wordpress.org/Uploading_Files">WordPress supported media files</a>.</p><h3>How to Verify the HTTP Error</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*OHIVp_LtGDhQxfv1.jpg" /></figure><p>There can be<strong> many possible causes for this issue</strong>, which is why WordPress displays such a vague message: HTTP error. Since this doesn’t put you any closer to the solution, <strong>you have to be analytical and look for the culprit in several places</strong>. Yet before you start panicking and digging, make sure the issue isn’t only temporary.</p><p>Sometimes, <strong>the HTTP error happens due to server glitches and a loss of internet connection</strong>. Both resolve on their own, so here’s how to determine whether you’re dealing with temporary issues.</p><h4>Checking for Temporary Issues</h4><p>If you are getting an HTTP error message, the first thing you should do is <strong>simply wait a few minutes and then try uploading the media file again</strong>. If the file is uploaded without any errors, the problem is solved.</p><p>If the previous step failed, <strong>try uploading a smaller image or media file</strong>. If you upload it successfully, you’ll know the issue was the size of the file. To avoid further issues, reduce the dimensions of the original image or change the file format. Upload it again. You can <strong>also try to change the image format if the issue persists</strong>.</p><p>If the issue persists,<strong> move on to browser-related tests</strong>. Try <strong>refreshing the page and re-uploading the image or media files</strong>. If your login session has expired, login to the dashboard and refresh the page by pressing the reload button or the “F5” key on your keyboard. Try reuploading the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*8ScycFx0q02G-QJw.jpg" /></figure><p>Keep in mind that, despite its popularity and wide use, <strong>Google Chrome is known to have issues with image upload</strong>. <strong>Switch your browser</strong> to Firefox, for example, and upload the image again. Also, clear the cache after completing each of these steps and try re-uploading the image or media file.</p><p>Clearing the cache after each step will allow you to pinpoint what exactly is causing the issue.</p><h4>Checking Your Plugins and Theme</h4><p>Sometimes the plugins you use, or even the theme itself, could be the culprit of the HTTP error. It is important to test thoroughly for every possible cause.</p><p><strong>Plugins that are prone to causing HTTP errors are usually image optimization or security plugins</strong>, so make sure you check those first. Deactivate plugins one by one, and after each is deactivated, try uploading an image or media file.</p><p>As soon as the image upload process is successful, you can pinpoint the last deactivated plugin as the source of the error.</p><p>To check the WordPress theme, make sure you <a href="https://qodeinteractive.com/magazine/how-to-manually-backup-wordpress-website/">backup your site first</a>. Then, switch your theme to a default theme (e.g., Twenty Twenty). If the issue is solved afterward, report it to the developers of your theme.</p><h4>Renaming the File</h4><p>One of the often-overlooked<strong> reasons for HTTP error is an incorrect file name</strong>.</p><p>When you’re naming your file, <strong>make sure you’re using letters, numbers, and dashes only</strong>. This means that special characters (for example, the apostrophe or the equals sign) and international language symbols should be avoided.</p><p>Our recommendation is to <strong>create a system of naming files</strong>. Add dashes between the words and a dash and a number at the end (e.g., my-uploaded-image-1.png, my-uploaded-image-2.png and so forth).</p><p>To determine if the incorrect file name is the source of the issue, <strong>rename the file in your local folder following our guidelines</strong>. Upload the renamed image or media file. If the error is no longer present, you’ll know the incorrect file name was the issue.</p><p>If the previous steps have given no result, it’s time to turn to some coding solutions. Don’t worry if you have no experience in this field — we’ll guide you every step of the way!</p><h3>How to Solve the HTTP Error</h3><p>Insufficient server memory is one of the common reasons for the HTTP error, since an increased memory limit is a requirement for the image upload process. Therefore, <strong>increasing the memory used by the server should solve the issue</strong>.</p><p>Before we delve into the possible methods of server memory increase, let’s mention <strong>two important prerequisites for this process</strong>.</p><ul><li>Increasing memory is only possible within the limits of your hosting package. Increasing it past these limits will likely result in an internal server error, the so-called error 500. Consult with your hosting provider about the change, especially if you are using shared hosting.</li><li>To perform the changes described in the following sections, you have to edit files using an FTP client.</li></ul><p>We will show you 4 ways to increase the memory limit.</p><h4>Memory Increase</h4><p>The first way to increase the memory limit requires you to edit the wp-config.php file. Simply add the following line of code in the wp-config.php file.</p><pre>define( ‘WP_MEMORY_LIMIT’, ‘256M’ );</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*V2ChKFUywRTGHypX.jpg" /></figure><p>The second method for increasing memory limit is <strong>changing the memory limit value within the cPanel</strong>.</p><p>Log in to <em>cPanel</em>, navigate to the <em>Software</em> section, and click on the “<em>MultiPHP INI Editor</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*YwrspWgK0bPZy6DA.jpg" /></figure><p>Then, select your domain, search for “memory_limit” and insert 256M as the value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*PActcourovsO4YWy.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*OTt3bU3KVt8rwc8M.jpg" /></figure><p>Another way to increase the memory limit is to <strong>edit the php.ini file, which is located in the root WordPress directory</strong>.</p><p>Open the file, search for <em>memory_limit</em> and change the value associated with it.</p><p>If the file isn’t there, create it and insert this line of code.</p><pre>memory_limit = 256M</pre><p>For some shared hosts, you have to<strong> edit the .htaccess file so the previous change can take effect</strong>. Make edits by adding the following code to your .htaccess file, near the top. Replace the “your_username” part with your actual cPanel username.</p><pre>&lt;IfModule mod_suphp.c&gt;</pre><pre>suPHP_ConfigPath /home/your_username/public_html</pre><pre>&lt;/IfModule&gt;</pre><p>The purpose of this code is to <strong>specify the directory of your php.ini file</strong>. With shared hosting, there are often multiple php.ini files, so you have to specify the exact location of the one you have edited or created. That’s the only way to execute the correct file and code and apply changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*a9pg-1doeifXOfi3.jpg" /></figure><p>Finally, <strong>you can increase the memory limit by editing the .htaccess file</strong>.</p><p>This file is also <strong>found in the root WordPress directory</strong>. It is a server configuration file and usually hidden.</p><p>To access it, you should enable the relevant option(s) for showing hidden files within the FTP client of your choice. If you use FileZilla, as we do, <strong>navigate to the Server tab and click on “Force showing hidden files”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*tFN3iSywm4ed5bI5.jpg" /></figure><p>Open the file, search for “memory_limit” and change the value associated with it. If no code is present, insert this line.</p><pre>php_value memory_limit 256M</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*03neAtuN672bpE8e.jpg" /></figure><h4>Image Editor Changes</h4><p>If the memory increase solution wasn’t successful, you can tackle the issue by <strong>adding code that modifies WordPress image editors</strong>.</p><p>WordPress relies on 2 image editor modules: GD Library and Imagick. They are used interchangeably. However, Imagick is known to cause memory drain, which leads to the HTTP error during image upload.</p><p>Therefore, one possible solution is to <strong>make the GD Library a default image editor</strong>. Simply add this code into functions.php of your theme, at the end of the file.</p><pre>function wpb_image_editor_default_to_gd( $editors ) {</pre><pre>$gd_editor = ‘WP_Image_Editor_GD’;</pre><pre>$editors = array_diff( $editors, array( $gd_editor ) );</pre><pre>array_unshift( $editors, $gd_editor );</pre><pre><strong>return</strong> $editors;</pre><pre>}</pre><pre>add_filter( ‘wp_image_editors’, ‘wpb_image_editor_default_to_gd’ );</pre><p>The code prioritizes GD Library in the list of available image editors. Whenever an image is uploaded, GD Library is always used as the first image upload option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*_T_13LBehGkNygXJ.jpg" /></figure><p>Let’s explain why Imagick may cause issues.</p><p>Imagick uses multiple threads for more efficient image processing. However, on many shared hosts, this use is considerably restricted, leading to the HTTP error.</p><p>Another solution to the Imagick issue could be to f<strong>orce this image editor to use a single thread</strong> for image processing.</p><p>If you want to try that, <strong>insert this line of code into your .htaccess file</strong>.</p><pre>SetEnv MAGICK_THREAD_LIMIT 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*Dq4RAImibzTz4KBo.jpg" /></figure><h3>Additional Troubleshooting Steps</h3><p>In most cases, the image upload problem should be solved by using one of the solutions provided in the previous sections. However,<strong> keep in mind there are many possible reasons for the error, and so far we’ve included the most common ones</strong>. Now let’s look into some of the less employed troubleshooting methods.</p><h4>Further Modifications of the .htaccess File</h4><p>Sometimes, the WordPress image upload process can result in an HTTP error due to the <em>mod_security</em> rule set on the server. <strong><em>Mod_security</em> is an open-source firewall used for security purposes</strong>. Sometimes, it can accidentally block the image upload. By removing/disabling it, you can solve the image upload issue.</p><p>To remove mod_security, add the following code to the top of your .htaccess file via an FTP client.</p><pre>&lt;IfModule mod_security.c&gt;</pre><pre>SecFilterEngine Off</pre><pre>SecFilterScanPOST Off</pre><pre>&lt;/IfModule&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*bKXx5vuqnJvIRUX3.jpg" /></figure><p>If the issue isn’t solved by adding code/changing the option, revert the change, as it may cause security issues.</p><p>Also, if your server is using Authentication Access Control, you should also add this code to your .htaccess file via FTP.</p><pre># Exclude the file upload and WP CRON scripts from authentication</pre><pre>&lt;FilesMatch “(async-upload\.php|wp-cron\.php|xmlrpc\.php)$”&gt;</pre><pre>Satisfy Any</pre><pre>Order allow,deny</pre><pre>Allow from all</pre><pre>Deny from none</pre><pre>&lt;/FilesMatch&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*FA6MCpMkrQMgIe-9.jpg" /></figure><h4>Changing File Permissions</h4><p>Having incorrect <a href="https://wordpress.org/support/article/changing-file-permissions/">file permissions</a> in your WordPress uploads folder is one of the many causes of the Image Upload error.</p><p>For the purposes of this article, <strong>we will only focus on the uploads folder</strong>, as it stores all the images uploaded to WordPress. Having improper permissions on your uploads folder can cause problems with image upload as well as show the already uploaded images as blanks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*FpUS-Y_eDtfvQjLj.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vUALbNF98kQcLQrM.jpg" /></figure><p>This issue can happen <strong>after a migration from another host</strong>. The solution is rather simple, you only need to manually set the proper permissions on the uploads folder.</p><p>Permissions can be changed via FTP, by right-clicking on the uploads folder and selecting <em>File Attributes</em>. Manually insert the numeric value and check both the “<em>Recurse into subdirectories</em>” and the “<em>Apply to directories only</em>” options.</p><p>The <strong>suggested permission for directories and subdirectories is 755</strong>. It grants the administrator of the site all the permissions — to read, write and modify, while the rest (non-admin users) have the rights to read and modify directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*E9Cnm9-_dXZqvijC.jpg" /></figure><h4>Contact Hosting Provider</h4><p>A reminder — <strong>make sure you clear the cache and run the test after each suggested step</strong>.</p><p>If the problem still isn’t solved despite closely following our directions, it is time to contact your hosting provider. Describe the issue and the ways you tried to solve it, and ask for further assistance.</p><h3>Final Thoughts</h3><p>Now you’re ready to go back to telling thousands of new stories with each image you add to your website.</p><p>While this guide cannot cover all the possible causes for an HTTP error, you’ll most likely find the solution to your problem here. Keep this tutorial in your bookmarks, so you can quickly deal with this relatively common issue whenever it comes up.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/fix-image-upload-http-error-wordpress/"><em>https://qodeinteractive.com</em></a><em> on March 19, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28695a5be7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add HTTPS and SSL to Your WordPress Website — Qode Interactive]]></title>
            <link>https://medium.com/@sasa.stojanovic876/how-to-add-https-and-ssl-to-your-wordpress-website-qode-interactive-f4c28618e15b?source=rss-8955ab895e95------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4c28618e15b</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Sasa Stojanovic]]></dc:creator>
            <pubDate>Tue, 03 Mar 2020 14:00:53 GMT</pubDate>
            <atom:updated>2020-09-23T08:55:32.032Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Add HTTPS and SSL to Your WordPress Website — Qode Interactive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZRlj3RjC7TQ_1J38.jpg" /></figure><p>A growing number of websites have been making the switch from HTTP to HTTPS protocol to increase security. HTTPS (Hypertext Transfer Protocol Secure) is a combination of two protocols: HTTP and SSL/TSL (Secure Socket Layer/Transport Layer Security). SSL encrypts all information (passwords, credit card information, and more) that are exchanged on your website, adding an important layer of protection. This makes HTTPS protocol mandatory for any eCommerce business and strongly recommended for any type of website that collects users’ information.</p><p>Apart from the secure transfer of information, there are other reasons why adding SSL to your site is beneficial. They include the prevention of malware infection, better long-term SEO ratings, and higher website loading speed.</p><p>Although you can’t go wrong with switching your website to HTTPS, there are plenty of ways things can get complicated with transferring to the new protocol — even for the more experienced WordPress users. This comprehensive guide was created to help both beginners and experienced site admins with adding HTTPS and SSL to WordPress websites. Carefully follow these steps and you will have a prized green padlock of security in no time!</p><p>If you’d like to take a shortcut to any specific part of this article, simply use one of the links below:</p><ul><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#acquiring-an-ssl-certificate">Acquiring an SSL certificate</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#moving-to-https">Moving to HTTPS</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#additional-steps">Additional steps</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#fix-wordpress-site-not-secure-mixed-content-error">How to Fix the WordPress Site Not Secure/Mixed Content Error</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#fix-net-err-cert-invalid-error">How to Fix the NET::ERR_CERT_INVALID Error</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#fix-http-to-https-redirect-error">How to Fix the HTTP to HTTPS Redirect Error</a></li><li><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#fix-too-many-redirects-error">How to Fix the Too Many Redirects Error</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*rdViJ5zqSw38rJUs.jpg" /></figure><h3>Acquiring an SSL certificate</h3><p><strong>An SSL certificate enables data encryption and site authentication</strong>. This assures the site visitors of your credibility and provides security for any information shared between a user and your website. Obtaining an SSL certificate is a prerequisite for the HTTPS moving process.</p><p>SSL certificates can be free or paid. Some hosting providers offer free SSL certificates in batch with domain hosting subscriptions. <strong>Begin by consulting with your hosting provider about the option to activate a free SSL certificate</strong>, either host-granted or a third-party certificate such as <a href="https://letsencrypt.org/">Let’s Encrypt</a>. Your hosting provider might also offer some advice on acquiring a high-quality paid SSL certificate.</p><p><strong>One of the important differences between various SSL certificates is the number of domains and sub-domains they can secure</strong>. Single certificates cover a single domain or sub-domain, wildcard ones cover a domain and all of its sub-domains, while the multi-domains cover multiple domains and all of its subdomains.</p><p>SSL certificates can be self-signed as well. To be recognized as safe by browsers, they have to be generated by a trustworthy third-party organization, also known as a certificate authority (CA). Self-signed certificates that aren’t verified by a CA will be marked as <em>not secure</em>, which defeats the purpose of an SSL certificate. Moreover, certain browsers can block these sites during the loading process. This is why it is best to avoid using self-signed SSL certificates.</p><h3>Moving to HTTPS</h3><p>Before you proceed, <strong>we strongly recommend that you </strong><a href="https://qodeinteractive.com/magazine/how-to-manually-backup-wordpress-website/"><strong>backup your WordPress site</strong></a>. You can do it manually, or you can ask your hosting provider for help.</p><p>With the site backed-up, you can safely proceed. We will show you two methods of changing your site from HTTP to HTTPS. The first option is using third-party SSL plugins. This method is more suitable for less-experienced WordPress users. The second option is more challenging, as it requires manual editing of files and URLs. This method is suitable for more experienced WordPress users. If you are not well-versed with programming yet insist on using this method to add HTTPS, we strongly recommend that you hire a developer to help you with the process.</p><h4>Using SSL plugins</h4><p>Since there are many WordPress SSL-related plugins, we can’t use all of them. For the purposes of this article, we will go over some of the more popular solutions. You are free to test or recommend other plugins as well — if you have time, let us know about your experiences in the comment section!</p><p><strong>One of the top-rated, user-friendly SSL plugins is </strong><a href="https://wordpress.org/plugins/really-simple-ssl/"><strong>Really Simple SSL</strong></a>.</p><p>To install this plugin, navigate to <strong>Plugins</strong> and press <strong><em>Add New</em></strong>. <strong>Search</strong> for the plugin and click on <strong><em>Install Now</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*T_NVsFwjY7_KkPtf.jpg" /></figure><p>Then, open <strong>Plugins &gt; Installed Plugins</strong>, review the notice carefully and click on the <strong><em>Go ahead, activate SSL!</em></strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ygUQdgFoSa3GtMwD.jpg" /></figure><p>At this point, you will probably have to reconnect to your WordPress dashboard.</p><p>Really Simple SSL plugin handles all the steps of HTTPS activation relatively well. One of the problems that may appear with this plugin is a mixed-content issue caused by leftover links using the HTTP protocol. <strong>Really Simple SSL plugin has a built-in feature called a mixed-content fixer that deals with this issue to some extent. However, keep in mind that this feature will not be able to change some HTTP assets (images, CSS and JS) and hardcoded HTTP links inside your .css and .js files</strong>.</p><p>To check if your site has the <strong>mixed-content fixer</strong>, navigate to <strong>Settings &gt; SSL</strong> and click on the <strong>Configuration tab</strong>. Make sure that a <strong>mixed-content fixer is enabled/detected</strong> on your front-end and then you’re ready to move to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ab5DPjBBxuvhWzFG.jpg" /></figure><p>Before the test, <strong>clear your browser cache and purge the cache with your caching plugin</strong>. Using other browsers and/or an incognito window within the current browser will have the same effect.</p><p>Start by <strong>reviewing your site</strong>, one page at a time. <strong>If the icon next to the page URL is a (green) padlock</strong> for all the pages (as seen in the screenshot at the beginning of the article), proceed to the <a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#additional-steps"><strong><em>Additional steps</em></strong> section</a> of this article.</p><p><strong>If the icon next to the page URL is the letter “i”</strong>, meaning <em>Info or Not secure</em>, you’ll need further troubleshooting to fix the mixed-content errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*UzqS3RJZoE7IPirs.jpg" /></figure><p>This type of error can also occur when you’re manually adding HTTPS and SSL to your website, so we gathered all of the troubleshooting advice into a single <a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#testing-solving"><strong><em>Testing and solving the mixed-content error</em></strong> sub-section</a>.</p><h4>Manually moving to HTTPS</h4><p>Although the manual move is more challenging, it is also more effective. It optimizes the whole process so you can address all the changes your website needs. There isn’t a significant technical difference between this and the plugin-based method, as both seek to create the same results. However, the manual method is more demanding because it requires small, focused changes to your website.</p><p>This method also requires the use of plugins, but the combination of manual and automatic edits is what makes this method a more efficient way to switch your site from HTTP to HTTPS. So let’s begin.</p><p>a) <strong>Updating the General Settings of your site</strong></p><p>General settings that are important for this process are the Site and WordPress Addresses. Site Address is the URL visitors have to type to access your site’s frontend. Your WordPress Address is the location of your WordPress folders and files. <strong>Since you want the location of your files to be secure and to enable the visitors to access your secure URL, changing both addresses is the first step</strong>.</p><p>Navigate to <strong>Settings &gt; General</strong> and update your <strong>WordPress and Site Address to HTTPS</strong>. Once you update them, don’t forget to click on <strong><em>Save Changes</em></strong> in the bottom left corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*wCTUAmTpcyd8I6Xq.jpg" /></figure><p><strong>This action will change only two addresses. The URLs of your content (pages, posts, attachments…) will remain unchanged, so you need to take additional steps to update them</strong>.</p><p>Also, when you’re switching your site to HTTPS, it is important that both the search engines and site users access the right page. <strong>You will enable this by adding </strong><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/#fix-http-to-https-redirect-error"><strong>301 (<em>Moved Permanently</em>) redirection</strong></a><strong> to any insecure or no longer valid links</strong>.</p><p>Without 301 redirection, WordPress would still link to posts and pages that use the HTTP protocol. However, those pages will no longer be at the old address. If the page is removed, the user will get a 404 error. Both situations are quite frequent and can harm user experience on your website. Apart from clearing this issue, adding 301 redirection will also help you improve your SEO.</p><p><strong>To add 301 redirection, insert the following code inside the .htaccess file.</strong></p><pre>&lt;IfModule mod_rewrite.c&gt;</pre><pre>RewriteEngine On</pre><pre>RewriteCond %{HTTPS} off</pre><pre>RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</pre><pre>&lt;/IfModule&gt;</pre><p>The <a href="https://qodeinteractive.com/magazine/find-htaccess-file-on-wordpress-site/">.htaccess is a hidden server configuration file</a> that can be edited via FTP. After enabling the option for <strong>showing hidden files</strong>, <a href="https://qodeinteractive.com/magazine/how-to-use-ftp/">connect to your server using your FTP</a> credentials. <strong>Navigate to the root WordPress directory, find the file, right-click on it and select “View/Edit”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*eBn-jEDbBp6Achx1.jpg" /></figure><p>Using the text editor of your choice, <strong>edit the file by inserting the code we’ve shown above. Save the changes and override the existing file with the edited one</strong>.</p><p><strong>If your hosting provider uses Nginx web servers, add this code in your nginx.conf file instead</strong>.</p><pre>server {</pre><pre>listen 80;</pre><pre>server_name example.com <a href="http://www.example.com;/">www.example.com;</a></pre><pre><strong>return</strong> 301 <a href="https://example.com$request_uri;/">https://example.com$request_uri;</a></pre><pre>}</pre><p><strong>Important note</strong>: replace all the instances of “example.com” in the code with your actual site URL.</p><p>c) <strong>Adding SSL to your admin area</strong></p><p>Adding security to your WordPress admin area is quite helpful, both when your SSL certificate has expired or when you are accessing your dashboard using public networks.</p><p><strong>To add the HTTPS protocol inside your WordPress admin, you will have to edit the wp-config.php file</strong>. Connect to your server using your FTP credentials and navigate to the <strong>root WordPress directory</strong>. Find the <strong>wp-config.php</strong> file, right-click on it and select <strong>View/Edit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*zkykmW0dd-fTrHpk.jpg" /></figure><p><strong>Open the file using a text editor and insert:</strong></p><pre>define(‘FORCE_SSL_ADMIN’, <strong>true</strong>);</pre><p><strong>above the /* That’s all, stop editing! Happy blogging. */ line. Save the changes and override the existing file with the edited one.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*b-gPhmoJNK8FURiT.jpg" /></figure><p>d) <strong>Changing content links</strong></p><p>The most important step in the HTTPS switching process is to <strong>update all the links inside your database</strong>. You can do this manually by executing MySQL queries or with the help of WordPress plugins.</p><p>If you want to do it manually you will have to access your database. <strong>If you are using cPanel, navigate to Databases and click on phpMyAdmin</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*AILcSNo1lsxxwkN8.jpg" /></figure><p><strong>If you aren’t using cPanel</strong>, consult with your hosting provider for guidance.</p><p>For the locally-hosted sites, we suggest using the XAMPP control panel, where you need to <strong>click on the Admin button next to MySQL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*9ZKuxQKUKa35gg6z.jpg" /></figure><p><strong>Navigate to the left side of your phpMyAdmin dashboard and select a database by clicking on it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*5HFFysSfBqu9wIL-.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*AINkyKj2EX8oKp50.jpg" /></figure><p>Now, click on the <strong>SQL tab</strong> near the top of your browser window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*vVhopcBt5JLv86Dg.jpg" /></figure><p>Before you proceed, make sure you <a href="https://qodeinteractive.com/magazine/how-to-backup-wordpress-database/">backup your database</a>, as any editing mistakes could be costly. Then, <strong>add the following code, while making sure to properly replace both URLs</strong> (without trailing slashes at the end). Click on the <strong>Go button</strong>, located in the lower right corner.</p><pre>UPDATE wp_posts SET post_content = REPLACE (post_content, ‘http://site-url.com&#39;, ‘https://site-url.com&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*i22WA_or9C-dJvuw.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ArRPrycJKdlaVACt.jpg" /></figure><p>When you get a green message near the top of your window stating “X row(s) affected.”, you will know the change was successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*NLudSImdC8WcTvgg.jpg" /></figure><p>The purpose of the code/query above is to change all instances of the <a href="http://site-url.com/"><em>http://site-url.com</em></a> to <a href="https://site-url.com/"><em>https://site-url.com</em></a> inside the content of all your posts. Similar codes can be created for changing the URLs found in custom fields for posts and users.</p><pre>UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://site-url.com&#39;,&#39;https://site-url.com&#39;);</pre><pre>UPDATE wp_usermeta SET meta_value = replace(meta_value, ‘http://site-url.com&#39;,&#39;https://site-url.com&#39;);</pre><p>The following code is optional and should be used cautiously.</p><pre>UPDATE wp_posts SET guid = replace(guid, ‘http://site-url.com&#39;, ‘https://site-url.com&#39;);</pre><p>Let’s elaborate why.</p><p>GUID is a column inside the wp_posts table and stands for “Globally Unique Identifier”. WordPress uses it when generating RSS feeds, as a constant that determines whether two posts are the same. For example, it will determine if one post was created from the other by changing the title, URL or parts of the content. This prevents your website from showing the same posts twice. If you change the GUIDs, all post duplicates will appear as new, separate posts and will be shown in your readers’ feed.</p><p>Therefore, it is strongly recommended <strong>not</strong> to change the GUID column. There are exceptions to this rule, such as switching domains or site development.</p><p><strong>If you want to use plugins to change content links</strong>, keep in mind that these tools require slightly more tech-savviness compared to plugins like Really Simple SSL. These tools offer a more targeted edit.</p><p>In this article, we decided to include two of these laser-focused plugins — <a href="https://wordpress.org/plugins/velvet-blues-update-urls/">Velvet Blues Update URLs</a> and <a href="https://wordpress.org/plugins/better-search-replace/">Better Search Replace</a>. You can use them separately or in combination.</p><p>You can find <strong>Velvet Blues Update URLs plugin</strong> by navigating to <strong>Plugins &gt; Add New</strong>. <strong>Enter a keyword</strong> and click on “<strong>Install Now</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*bgyOz8BG8y8CGmbZ.jpg" /></figure><p><strong>Navigate to Tools &gt; Update URLs. In the Step 2 section, choose which URLs to update.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*VDh3S6anyhpvf6xy.jpg" /></figure><p>You can add <strong>Better Search and Replace plugin</strong> the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*Z8JkvGdw9OKA--Ud.jpg" /></figure><p>When you install and activate the plugin, navigate to <strong>Tools &gt; Better Search Replace</strong> and click on the <strong>Search/Replace tab</strong>.</p><p><strong>Insert the HTTP:// and HTTPS:// version of your URL (or just HTTP:// and </strong><a href="http://https//)"><strong>HTTPS://)</strong></a><strong> in the Search for and Replace with fields, respectively.</strong> You also get to choose which <strong>database columns</strong> the search/replace query gets to run and get <strong>the option of a test run</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ACT2WdqSVTneSptS.jpg" /></figure><p>e) <strong>Testing and solving the mixed-content error</strong></p><p>A quick reminder — <strong>clearing all cache before reviewing your pages is mandatory</strong>. In this section, we will show you what to do if the icon next to your page URLs keeps displaying the letter “i”, which means “Info” or “Not Secure”.</p><p><strong>Having a mixed-content error means that there are still links that are using HTTP. Therefore, the first thing to do is to find those links.</strong></p><p><strong>You can do it by inspecting the site within your browser’s developer console or by examining it on the </strong><a href="https://www.whynopadlock.com/"><strong>Why no padlock</strong></a><strong> website.</strong></p><p>For the first option, <strong>view any page, right-click inside its content and click on Inspect</strong>. You can also run this test by <strong>pressing F12</strong> on your keyboard while you’re on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*edQXZvMXTkLb50jl.jpg" /></figure><p>Then, click on the <strong>Console tab</strong>. This tab shows the errors present on your website. Look specifically for the ones that contain the words “<strong>Mixed Content</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*321UdFzLTx29vb1C.jpg" /></figure><p><strong>Alternatively, you can paste your page URL to </strong><a href="https://www.whynopadlock.com/"><strong>Why no Padlock</strong></a>, confirm you aren’t a robot, click on “<strong>Test Page</strong>” and wait a couple of moments for the error report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*eiwI2XGM_BSVqsNC.jpg" /></figure><p>When you create the list of unsecured links, you can update them. These HTTP links could be located almost anywhere, including your posts, theme files and the plugins you are using. For the most part, these errors should already be solved with the use of plugins. However, hard-coded links coming from HTTP sites may be trickier to change.</p><p><strong>To solve this issue, you need to locate these links first. While browser-inspecting your page, click on the 3 vertical dots in the bottom-left corner of the screen.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*Jo36-0EfF9pLWA3J.jpg" /></figure><p>Click to open the “<strong>Search</strong>” <strong>tab</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*e8xToX8yC7xuCeLH.jpg" /></figure><p>To see the content of the “Search” tab, drag it upwards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*0nU8kPd7yhGvSiZD.jpg" /></figure><p><strong>Insert the insecure link in the search bar, press Enter on your keyboard and click on the result(s) to review the code.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*DyqfRbjNijT6Oh0P.jpg" /></figure><p><strong>Edit the hardcoded link using a text editor</strong>. In case this link is part of the theme or plugins, consult with its authors for additional assistance.</p><p><strong>Insecure links within theme options or widgets must be removed</strong>. If you have insecure links within theme options, check the theme documentation for specific instructions. When removing insecure links from the widgets (<strong>Appearance &gt; Widgets</strong>), pay special attention to text widgets, which may contain insecure links added using HTML code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*8VxWCV9iPLt9LnLT.jpg" /></figure><p><strong>Update the insecure links one at a time, always making sure to clear/flush your cache and review the pages afterward.</strong></p><p><strong>Additionally, we will include instructions on how to solve the same errors using Elementor</strong>. This page builder makes this process much easier.</p><p>Start by <strong>updating your site address URL</strong> via the Elementor options. Navigate to <strong>Elementor &gt; Tools</strong> and click on the <strong>Replace URL tab</strong>. Insert your old (with <a href="http://)/">http://)</a> and new site address (with <a href="https://)/">https://)</a> and click on the “<strong>Replace URL</strong>” <strong>button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*fZ-3S9bVwde_e3O_.jpg" /></figure><p><strong>Continue by recreating your CSS files</strong>. Navigate to <strong>Elementor &gt; Tools</strong> and click on the <strong>General tab</strong>. As the final step, click on the “<strong>Regenerate Files</strong>” <strong>button</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ycF_uDmmW1J4lu_w.jpg" /></figure><h3>Additional steps</h3><p>We’re almost done, but there are still some things you shouldn’t overlook if you want a safe and complete switch to HTTPS. These small updates will significantly improve your website’s performance. If they seem too challenging, you could find a developer to help you out.</p><p>a) <strong>Update your property on Google Search Console</strong></p><p>Google Search Console offers tools that can greatly improve your site’s performance. Those tools can enhance your SEO ratings, help troubleshoot issues on mobile and produce crucial reports regarding the usage of your site (most viewed pages, keywords, countries of your site users, etc.).</p><p><strong>To avoid lagging performance and incomplete reports, it is important to update your property after switching the site to HTTPS.</strong></p><p><strong>Navigate to the </strong><a href="https://search.google.com/search-console/welcome"><strong>Google Search Console</strong></a><strong>, choose a property type and insert your site’s URL.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*j7skbSmOD1-fZyw_.jpg" /></figure><p>You have to <strong>verify the ownership of the site/property</strong>. There are two property types: Domain and URL prefix. Domain type handles all of subdomains and HTTP and HTTPS site versions. However, it has only one verification method — DNS verification.</p><p>The URL prefix property type allows multiple verification methods that are easier to perform. However, it handles HTTP and HTTPS property separately.</p><p>Choose the property type best suited to your needs and level of knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*cOFAxQg8NDf5zi_j.jpg" /></figure><p>b) <strong>Update your sitemap</strong></p><p>A sitemap offers a more structured way for search engines to interpret your site. It is an XML file designed for search engine bots, rather than humans. That file lists the pages your site contains and recent changes to these pages. Using a sitemap, search engines and crawlers can easily crawl and index your site.</p><p>Therefore, <strong>if your site was changed to HTTPS, it is important to update your sitemap file and notify the Google Search Console about it</strong>. Some SEO plugins might update the file automatically, while others require creating the site map file once more.</p><p>After you create the new sitemap file, log in to <strong>Google Search Console</strong>. Click on <strong>Sitemaps</strong> and paste the URL of the new XML file to the “<strong>Add a new sitemap</strong>” <strong>bar</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*hhCxN6jmYpEyM5b8.jpg" /></figure><p>c) <strong>Update site URL on Google Analytics</strong></p><p>Google Analytics is the most popular web analytics service. It gathers and analyzes user activity data (e.g. bounce rate, number of sessions and its duration), website speed-related info (e.g. average page load time and average server response time), eCommerce-related data (e.g. number of transactions and revenue) and much more. If you want to keep receiving this data, <strong>it is important to update the site URL on Google Analytics after the SSL change</strong>.</p><p>To update the site URL, click on the <strong>Admin section</strong> and select <strong>Property Settings</strong>. Find the <strong>Default URL setting</strong>, click on the part of the URL noting the protocol and select <strong>https://</strong> from the dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*LkGoPQP0I5QcM-Ma.jpg" /></figure><p>d) <strong>Update the URL in your CDN</strong></p><p>CDN stands for content delivery network and it is an important factor for your website’s speed, especially for sites with high traffic rates. CDN, however, should not be confused with your hosting, as CDN should only be used for serving static site resources: CSS and JS stylesheets and images.</p><p>Thus, <strong>updating URL(s) in your CDN is also mandatory after switching to HTTPS protocol</strong>. As the process depends on the particular CDN, we suggest that you <strong>refer to your CDN provider</strong> for further instructions.</p><h3>Final thoughts</h3><p>If you followed these steps, your website should be up and running with its new HTTPS protocol. If any issues arise later on, this guide should help you solve them quickly and efficiently. Don’t forget to run regular checks and pay attention to your website’s security, as cyber safety is no longer just a matter of preventing attacks — it is also an important factor in your site’s ranking and credibility.</p><p><em>Originally published at </em><a href="https://qodeinteractive.com/magazine/add-ssl-wordpress/"><em>https://qodeinteractive.com</em></a><em> on March 3, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4c28618e15b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>