WP-RestAPI and xml sitemap

Let’s assume your plugin is writing to the /usr/share/wordpress/sitemap_index.xml filesystem location, but you want it can be accessed through http://www.website.com/sitemap_index.xml as if the xml file were stored in /var/www/html/sitemap_index.xml. You can use the alias directive then, available in mainstream webservers Apache and NginX: For an alias in NginX, you put this inside the server of … Read more

Get wp_title wp ajax

YOAST’s SEO Title is stored within a meta_key. Try this- $taxonomy = get_queried_object()->taxonomy; $term_id = get_queried_object()->term_id; $meta = get_option( ‘wpseo_taxonomy_meta’ ); $title = $meta[$taxonomy][$term_id][‘wpseo_title’]; Or this- $titles = get_option( ‘wpseo_titles’ );

With the Yoast SEO plugin, is it possible to make the meta description a required form field?

An alternate way to avoid empty meta description field is to set a default meta description using meta template variables in the dashboard. This article in the Yoast knowledge base explains how to do this and lists the available variables: https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/ Here’s what I ended up doing: Login as admin. In dashboard: SEO >Titles and … Read more

force category base – archive pages work WITH & WITHOUT category base slug in url?

I found a solution here: 404 on category.php pagination So, to fix my issue I just needed to add these custom rewrite rules to functions.php: add_action( ‘init’, ‘wpa58471_category_base’ ); function wpa58471_category_base() { add_rewrite_rule( ‘blog/([^/]+)/page/(\d+)/?$’, ‘index.php?category_name=$matches[1]&paged=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘blog/([^/]+)/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&feed=$matches[2]’, ‘top’ ); } Now, all blog pages work, including main blog page, archives, categories, and … Read more

Need Help Correct Regular Expression Redirect Code

At the top of your .htaccess file, before your existing WordPress directives, you could do something like the following to redirect the old permalink: RewriteRule ^\d{4}/\d\d/([\w-]+\.html)$ /$1 [R=301,L] The RewriteRule pattern matches against the URL-path less the slash prefix. \d{4}/ – matches the 4-digit year, followed by a slash. \d\d/ – matches the 2-digit month … Read more

Post content blank after disabling Yoast SEO

Turns out the single-post.php template was missing a call to the_post(). Since that function initializes all the postdata used by functions like the_content(), WordPress had nothing to display. As for Yoast SEO, I’m guessing it calls the_post() somewhere early on which would populate the WordPress global variables. If the theme was written with Yoast SEO … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)