Should I block .in or .pw malicious websites on my Disavow list?

I have malicious links like .pw and .in on my google reject list. Everyone already knows these sites. It hurts my site as there are too many links on these sites. That’s why I block them on my reject list.

An SEO expert told me that you only block +18 or hacklink links, you know those links are bad in google already. He said you don’t need to block those connections.

Do you think I should add these links to my google disavow list?

ACF and Gutenberg block, how to use blocks without ?

I’m working with Gutenberg blocks via ACF. It’s great compromise between classic / ACF and the Gutenberg. Another great thing is <InnerBlocks />. However, in one block can be used only one <InnerBlocks /> tag, so it’s kind of problematic, if I want to have more control over the html structure in my block. So: I have block with two divs (two columns). In each one I want to use Gutenberg blocks. Is there any way to insert specified block directly in my code, like image or group, without inner block?

How add Filter by Tags and by categories to custom post type in Gutenberg block

I need to add Filter by Tags and by categories to custom post type in Gutenberg block. I have created a CPT called "newsfeed" and it is displayed correctly in the page editor as shown in the following image.

newsfeed

but does not have the options Filter by Categories and by Filter by Tags like in the post type "Posts".

What can I do to enable these options?

posts

This is the code I use to create the newsfeeds

function add_tags_categories_taxonomy_x5642() {     $  labels = array(         'name'              => _x( 'Feed Tags', 'taxonomy general name' ),         'singular_name'     => _x( 'Feed Tag', 'taxonomy singular name' ),         'search_items'      => __( 'Search Feed Tags' ),         'all_items'         => __( 'All Feed Tags' ),         'edit_item'         => __( 'Edit Feed Tag' ),          'update_item'       => __( 'Update Feed Tag' ),         'add_new_item'      => __( 'Add New Feed Tag' ),         'new_item_name'     => __( 'New Feed Tag' ),         'menu_name'         => __( 'Feed Tags' ),     );     $  args = array(         'labels' => $  labels,         'show_ui' => true,         'show_in_rest' => true,         'show_admin_column' => true,         'query_var' => true,     );     register_taxonomy('feeds_tags', 'newsfeed', $  args);          $  labels = array(         'name'              => _x( 'Feed Symbols', 'taxonomy general name' ),         'singular_name'     => _x( 'Feed Symbols', 'taxonomy singular name' ),         'search_items'      => __( 'Search Feed Symbols' ),         'all_items'         => __( 'All Feed Symbols' ),         'edit_item'         => __( 'Edit Feed Symbols' ),          'update_item'       => __( 'Update Feed Symbols' ),         'add_new_item'      => __( 'Add New Feed Symbols' ),         'new_item_name'     => __( 'New Feed Symbols' ),         'menu_name'         => __( 'Feed Symbols' ),     );     $  args = array(         'labels' => $  labels,         'show_ui' => true,         'show_in_rest' => true,         'show_admin_column' => true,         'query_var' => true,     );     register_taxonomy('feeds_symbols', 'newsfeed', $  args);      register_taxonomy_for_object_type('category','newsfeed'); } add_action('init', 'add_tags_categories_taxonomy_x5642');  function add_feed_post_type_x1234($  query) {     if ( is_home() && $  query->is_main_query() ) {         $  query->set('post_type', ['post', 'newsfeed']);     }     return $  query; } add_action('pre_get_posts', 'add_feed_post_type_x1234'); 

Block access to multiple files with .htaccess – RewriteRule and FilesMatch fail [closed]

I am trying to block access to specific files. Neither the RewriteRule or FilesMatch rules I have tried work on the live server, it serves the files as normal with status 200 OK (I’m expecting 404 Not Found).

The regex I am using for FilesMatch is (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?). I have tested it at https://regexr.com/ and it is successful for

  • /readme.html
  • /wp-content/test.txt
  • /_test/test.txt

I have also tested the RewriteRule at https://htaccess.madewithlove.be/. It is successful for URL https://www.example.com/readme.html and https://www.example.com/wp-content/test.txt with .htaccess rule RewriteRule (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?) - [R=404,NC,L].

I have seen the answer at https://stackoverflow.com/a/51132806/3204075 The following does not work for me, I still get 200 OK for readme.html and test.txt in the root directory.

<filesMatch "(readme\.html|test\.txt)">     Order Allow,Deny     Deny from all </filesMatch> 

Can anyone suggest why the following FilesMatch and RewriteRules appear to be ignored by Apache?

RewriteRule

RewriteRule (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?) - [R=404,NC,L] 

FilesMatch

<FilesMatch (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?)>   # since apache 2.4: Require all denied   Order Allow,Deny   Deny from all </FilesMatch> 

Environment

  • Cloudways
  • Nginx 1.19.8-0
  • Apache/2.4.25 (Debian)

Thanks,

Chris

Rerender core Templates with with ToggleControl but it doesnt recognize block type

Hey Guys I want to change my const TEMPLATE = [template] dynamically with the <InnerBlocks template={TEMPLATE} /> component. Based on a toggle I want to remove my ‘core/image’ block. I tried to create this with state and I set the state of my template and columns when I toggle them. Gutenberg gives a blocktype ‘r’ not recognized error.

My index.js file of the block can be found in here

const { __ } = wp.i18n; import './styles/editor.scss' import './styles/style.scss' import edit from './edit'; import save from './save';  /**  * Register block  */  export const name = 'toolbox/three-cta';  export const settings = {     title: __("Three CTA Block"),     description: __("Display CTA block"),     category: "widget",     icon: "awards",     attributes: {         paragraph: {             type: 'string',             default: '',             source: 'html',             selector: 'p'         },         heading: {             type: 'string',             source: 'html',             selector: 'h2'         },         cards: {             type: 'number',             default: 0,         },         toggleImg: {             type: 'boolean',             default: false,         }     },     edit,     save, }  

And in edit.js these attributes gets changed. I think it has something to do with the core blocks I might be setting. But I didnt change the names of these core blocks, so I dont understand why Gutenberg doesnt recognize it.

import { InnerBlocks, InspectorControls } from "@wordpress/block-editor"; import { __ } from "@wordpress/i18n"; import { PanelBody, PanelRow, RangeControl, ToggleControl } from "@wordpress/components"; import { useDispatch, useSelect } from "@wordpress/data"; import { createBlock } from "@wordpress/blocks"; import { useState } from "@wordpress/element"; const { times } = lodash;   // const TEMPLATE = [ // The template that should be reproduced. Based on the toggle  [ "core/image", {} ], should be removed //  [ 'core/heading', { placeholder: 'Three CTA Block' } ], //  [ 'core/columns', {}, [ //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ], //      ] //      ], //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ], //      ] //      ], //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ] //      ] //      ], //  ] //  ] ];  export default function edit( props ) {     const { className, attributes, setAttributes, clientId } = props;      // code for the rangeControl Innerblocks doesnt affect the code (if not clicked on the rangeControls)     const { replaceInnerBlocks } = useDispatch( "core/block-editor" );     let { inner_blocks } = useSelect( select => ( {         inner_blocks: select( "core/block-editor" ).getBlocks( clientId )     } ) );      let [column, setColumn] = useState([ 'core/column', {}, [         [ "core/heading", { placeholder: __( "PLACEHOLDER" ) } ],         [ "core/paragraph", { placeholder: "CTA P" } ],         [ "core/button", { placeholder: "CTA Button" } ],     ]])       const [template, setTemplate] = useState([         ["core/heading", { placeholder: "Three CTA Block" }],         ["core/columns", {}, [...column]],     ])        const toggleChange = (value) => {         setAttributes({ toggleImg: value })         // const newColumn = column += ['core/column', {}, [["core/image", {}],]];         const newColumn = [ 'core/column', {}, [             [ "core/image", {} ],             [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ],             [ "core/paragraph", { placeholder: "CTA Description" } ],             [ "core/button", { placeholder: "Call to Action" } ],         ]]          setColumn(newColumn);         setTemplate([             ["core/heading", { placeholder: "Three CTA Block" }],             ["core/columns", {}, [...newColumn]],         ])      }      const getInspector = () => {         return (                 <InspectorControls>                     <PanelBody                             title="Add columns"                             initalOpen={true}                     >                         <PanelRow>                             <RangeControl                                     label="columns"                                     value={attributes.cards}                                     min={0}                                     max={3}                                     onChange={count => {                                         let new_innerblocks = inner_blocks                                         if ( attributes.cards < count ) {                                             new_innerblocks = [                                                 ...inner_blocks,                                                 ...times( count - attributes.cards, () =>                                                         createBlock( "toolbox/three-cta" )                                                 )                                             ];                                         } else if ( attributes.cards > count ) {                                             inner_blocks = inner_blocks.slice( 0, count )                                         }                                         replaceInnerBlocks( clientId, new_innerblocks, false );                                     }}                             />                         </PanelRow>                         <PanelRow>                             <ToggleControl                                     label="Toggle me"                                     checked={attributes.toggleImg}                                     onChange={(value) => toggleChange(value)}                             />                         </PanelRow>                     </PanelBody>                 </InspectorControls>         )     }      return (             <>                 {getInspector()}                 <div className={className}>                     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.6.3/dist/css/foundation.min.css" integrity="sha256-ogmFxjqiTMnZhxCqVmcqTvjfe1Y/ec4WaRj/aQPvn+I=" crossOrigin="anonymous"/>                     <div className="grid-x">                         <div className="cell small-12">                             <InnerBlocks template={template} templateLock="true"/>                         </div>                     </div>                 </div>             </>     ); } 

Setting fallback (default) image to featured image block

I was trying to make a block based theme and encountered a problem trying to set a default featured image in case some posts do not have them.

Basically, we used to do this in php

<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> 

But now with blocks, themes are html and all I can see is

<!-- wp:post-featured-image {"isLink":true} /--> 

I couldn’t find any other parameters here nor an if/else block so I could just add a plain html.

If anyone has done this, that would be of great help.

Thanks.

Dequeue Gutenburg Block Library CSS (‘wp-block-library’) in Admin

I am working on removing the default Gutenberg block library stylesheet and replacing it with custom pared-down styles. I do not want the original stylesheet to load on either the front or back end, as it means I’d need to add unnecessary bulk to the custom styles in order to override styles in the default stylesheet.

I’ve successfully dequeued the styles from the front end using the standard in a wp_enqueue_scripts action:

function test_function(){     wp_dequeue_style('wp-block-library'); } add_action( 'wp_enqueue_scripts', 'test_function' ); 

However, this does not dequeue the styles from the block editor. I have tried dequeuing from an admin_init action as well, and that also does not remove the styles from the block editor.

Is it possible to dequeue this stylesheet from both the front-end and the admin block editor?

Block some subdomains using robots.txt -Angular website with IIS [duplicate]

We have a testing environment with the surprising sub-domain name tests and I would like to block it to search engines.

How can I let Google scan my site https://example.com and block https://tests.example.com, but allow https://app.example.com.

I already read other answers but they were not relevant to me because I don’t use Apache and also this is an Angular website so adding a file in a subdomain won’t help.

Thank you!