Create Custom Rest Endpoints for WP Rest API
I found a very nice WordPress plugin that can be used to add custom rest endpoints for WP Rest API without touching the PHP code! You can complex custom routes easily, for example you can create a GET...
View ArticleHow to Downgrade WordPress to an Older Version
Today I installed WordPress 5.1.1 and it was a total mess. I had issues when publishing new posts, it was slower than v4.9.8, etc. So I decided to downgrade to v4.9.8 and to do this I installed: WP...
View ArticleHtaccess file for WordPress websites
Create a .htaccess file on the root directory of your website. Then copy the content below on the .htaccess file: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L]...
View ArticleIntegrate Disqus on WordPress programmatically
To integrate Disqus programmatically on WordPress single.php just set: var disqus_config = function () { this.page.url = ''; // Replace PAGE_URL with your page's canonical URL variable...
View ArticleWordPress Archive Page for Custom Post Type
Get archive link for a specific post type: The post WordPress Archive Page for Custom Post Type appeared first on Query Admin.
View ArticleWordPress Migrate from HTTP to HTTPS
Simple guide to migrate WordPress from HTTP to HTTPS: 1) Install free SSL certificate with Lets Encrypt 2) Enable SSL HTTP/2 for best performances 3) Change WordPress Site URL Open the...
View ArticleDisable WordPress Embeds
Some users have reported that the json URLs are sometimes indexed by Google: http://www.site.com/wp-json/oembed/1.0/embed?url=http%3A... To disable WordPress embeds you can use this plugin:...
View ArticleConstant WP_POST_REVISIONS already defined
If you get this warning message in your WordPress website: Notice: Constant WP_POST_REVISIONS already defined in /var/www/wordpress/wp-config.php on line 95 Make sure that the definition of the...
View ArticleUpdate a WordPress Plugin via UNIX Shell Prompt
Need to update a WordPress plugin via UNIX shell prompt? Open the /wp-content/plugins directory, example: cd /var/www/wpsite.com/htdocs/wp-content/plugins Let’s say you need to update WordPress SEO...
View ArticleUpdate WordPress from UNIX Shell Prompt
Need to update WordPress from UNIX shell prompt? Set the current directory to the root folder of WordPress installation: cd /var/www/wpsite.com/htdocs/ Now type these commands to update WordPress to...
View ArticleDisable the Plugin and Theme Editor on WordPress
To disable only the file editor (but allow for plugins and themes installation), simply add this line to your wp-config.php file (above the “ABSPATH” otherwise it won’t work):...
View ArticleDisable Plugin and Theme Update and Installation on WordPress
Prevents users from being able to update or install plugins and themes, plus removes the “Editor” menu so users can’t edit files. Add this line to your wp-config.php file (above the “ABSPATH” otherwise...
View ArticleChange Siteurl with MySQL Queries on WordPress
To change the siteurl of your WordPress site, use these SQL queries: UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name =...
View ArticleDisable XML-RPC in WordPress
WordPress uses XML-RPC to remotely execute functions. For example, Jetpack and the WordPress mobile application use xmlrpc to remotely manage a WP site. However, also attackers try to exploit the...
View ArticleRemove WordPress Emojis
If you do not plan to use the emoticons and emojis in your blog you can easily disable them by adding these lines to your functions.php file: remove_action( 'wp_head', 'print_emoji_detection_script', 7...
View ArticleRemove WordPress Admin Bar
Edit your functions.php file and add: add_filter('show_admin_bar', '__return_false'); The post Remove WordPress Admin Bar appeared first on Query Admin.
View ArticleCreate a screenshot of a website with PHP
Using the WordPress mShot API we can generate thumbnails of websites: function capture_website_screenshot( $website, $saveas ) { $url =...
View ArticleWordPress get Page ID outside the Loop
The recommended way to get the Page ID outside the loop is: $page_object = get_queried_object(); $page_id = get_queried_object_id(); The post WordPress get Page ID outside the Loop appeared first on...
View ArticleFixed height and vertical scrollbar on SyntaxHighlighter Evolved
With SyntaxHighlighter Evolved you can post syntax-highlighted code on your site. You can set a fixed height and vertical scrollbar by adding this code: <style type="text/css"> .syntaxhighlighter...
View ArticleOrganize uploads folder by Post ID, Slug, Author, Media Type
Very useful code snippet that can help you to organize the uploads folder of WordPress by post_name (aka slug), post_author, post_id or media type (such as videos, images, documents, etc). This is an...
View Article